]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests/server: give global `path` variable a more descriptive name
authorViktor Szakats <commit@vsz.me>
Wed, 12 Mar 2025 21:35:23 +0000 (22:35 +0100)
committerViktor Szakats <commit@vsz.me>
Fri, 14 Mar 2025 11:04:39 +0000 (12:04 +0100)
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
tests/server/sws.c
tests/server/tftpd.c
tests/server/util.c
tests/server/util.h

index 9d6a58b9a35c721b1271bf6a2560844c11a52d88..bf0acce1ed837b2f175e54249f382de9eaa91ea1 100644 (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++;
       }
     }
index ef3d126a64205e451983c8af61d8366991a506a8..df73f69257847b504eaa8bd0461b6a741fb7664c 100644 (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++;
       }
     }
index 8fca655990075197dbb1b3d34bd6a9711db2744c..8b63ca2f4e05c984b0ecc037ee2d479de7b34ba4 100644 (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++;
       }
     }
index 5bca95a1b84cabd896ee2044e9723feeef0455de..de25857498b34f75f6b02cd03173a77bf413955b 100644 (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;
index 9be412216acb67e3564f24321647b085ad540c23..aac31b6256f8686ffa3ca719da2fe871b10e650b 100644 (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 */