From 43b28846555248d225311f278133d267dedbc118 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 12 Mar 2025 22:35:23 +0100 Subject: [PATCH] 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 --- tests/server/rtspd.c | 2 +- tests/server/sws.c | 2 +- tests/server/tftpd.c | 2 +- tests/server/util.c | 4 ++-- tests/server/util.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index 9d6a58b9a3..bf0acce1ed 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -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++; } } diff --git a/tests/server/sws.c b/tests/server/sws.c index ef3d126a64..df73f69257 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -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++; } } diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 8fca655990..8b63ca2f4e 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -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++; } } diff --git a/tests/server/util.c b/tests/server/util.c index 5bca95a1b8..de25857498 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -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; diff --git a/tests/server/util.h b/tests/server/util.h index 9be412216a..aac31b6256 100644 --- a/tests/server/util.h +++ b/tests/server/util.h @@ -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 */