tests/server: give global path variable a more descriptive name

Use a more descriptive global variable name in server code, also
to avoid colliding with this name used elsewhere in libcurl.

This isn't causing an issue at this time, but makes the code prone
to `-Wshadow` warnings in unity mode, if the global variable is
compiled first. This specific variable could collide with the `path`
argument of the `curlx_win32_stat()` function.

Closes #16719
This commit is contained in:
Viktor Szakats 2025-03-12 22:35:23 +01:00
parent 3588df9478
commit 43b2884655
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
5 changed files with 6 additions and 6 deletions

View file

@ -1086,7 +1086,7 @@ int main(int argc, char *argv[])
else if(!strcmp("--srcdir", argv[arg])) {
arg++;
if(argc > arg) {
path = argv[arg];
srcpath = argv[arg];
arg++;
}
}

View file

@ -2123,7 +2123,7 @@ int main(int argc, char *argv[])
else if(!strcmp("--srcdir", argv[arg])) {
arg++;
if(argc > arg) {
path = argv[arg];
srcpath = argv[arg];
arg++;
}
}

View file

@ -608,7 +608,7 @@ int main(int argc, char **argv)
else if(!strcmp("--srcdir", argv[arg])) {
arg++;
if(argc > arg) {
path = argv[arg];
srcpath = argv[arg];
arg++;
}
}

View file

@ -229,7 +229,7 @@ const char *sstrerror(int err)
#endif /* _WIN32 */
/* set by the main code to point to where the test dir is */
const char *path = ".";
const char *srcpath = ".";
FILE *test2fopen(long testno, const char *logdir2)
{
@ -242,7 +242,7 @@ FILE *test2fopen(long testno, const char *logdir2)
return stream;
/* then try the source version */
msnprintf(filename, sizeof(filename), "%s/data/test%ld", path, testno);
msnprintf(filename, sizeof(filename), "%s/data/test%ld", srcpath, testno);
stream = fopen(filename, "rb");
return stream;

View file

@ -43,7 +43,7 @@ unsigned char byteval(char *value);
#define SERVERLOGS_LOCKDIR "lock" /* within logdir */
/* global variables */
extern const char *path; /* where to find the 'data' dir */
extern const char *srcpath; /* where to find the 'data' dir */
extern const char *pidname;
extern const char *portname;
extern const char *serverlogfile; /* log file name */