]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
src: drop support for `CURL_TESTDIR` debug env
authorViktor Szakats <commit@vsz.me>
Wed, 1 Jan 2025 22:14:13 +0000 (23:14 +0100)
committerViktor Szakats <commit@vsz.me>
Thu, 2 Jan 2025 13:44:39 +0000 (14:44 +0100)
No longer used by curl tests.

`--output-dir` option can be used as an alternative in all builds.

Follow-up to 39697dead3e7e3366941fe740226d56f30e6fc9e #15114
Closes #15893

src/tool_cb_hdr.c
src/tool_operhlp.c

index 1b0348d23cb7621aa4812c34e02d18bd95c51cfd..d9cf52437d91e9ad16f9c8c2bdf0a6b8a60420d3 100644 (file)
@@ -392,26 +392,6 @@ static char *parse_filename(const char *ptr, size_t len)
   }
 #endif /* _WIN32 || MSDOS */
 
-  /* in case we built debug enabled, we allow an environment variable
-   * named CURL_TESTDIR to prefix the given filename to put it into a
-   * specific directory
-   */
-#ifdef DEBUGBUILD
-  {
-    char *tdir = curl_getenv("CURL_TESTDIR");
-    if(tdir) {
-      char buffer[512]; /* suitably large */
-      msnprintf(buffer, sizeof(buffer), "%s/%s", tdir, copy);
-      Curl_safefree(copy);
-      copy = strdup(buffer); /* clone the buffer, we do not use the libcurl
-                                aprintf() or similar since we want to use the
-                                same memory code as the "real" parse_filename
-                                function */
-      curl_free(tdir);
-    }
-  }
-#endif
-
   return copy;
 }
 
index e4cdb45aa7bd5bc9939ea60a05dfd9bceef7c495..78d4e0adf88ab26d8631b302837f8f889950868d 100644 (file)
@@ -238,23 +238,6 @@ CURLcode get_url_file_name(struct GlobalConfig *global,
       }
 #endif /* _WIN32 || MSDOS */
 
-      /* in case we built debug enabled, we allow an environment variable
-       * named CURL_TESTDIR to prefix the given filename to put it into a
-       * specific directory
-       */
-#ifdef DEBUGBUILD
-      {
-        char *tdir = curl_getenv("CURL_TESTDIR");
-        if(tdir) {
-          char *alt = aprintf("%s/%s", tdir, *filename);
-          Curl_safefree(*filename);
-          *filename = alt;
-          curl_free(tdir);
-          if(!*filename)
-            return CURLE_OUT_OF_MEMORY;
-        }
-      }
-#endif
       return CURLE_OK;
     }
   }