mirror of
https://github.com/curl/curl.git
synced 2026-07-28 01:13:07 +03:00
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:
parent
3588df9478
commit
43b2884655
5 changed files with 6 additions and 6 deletions
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue