summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-05-28 16:32:07 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-28 16:37:36 +0200
commit6b42584c36cd980882fec7b082e44b0b669b9d1f (patch)
tree5d6c260d9ddf7a4adb60ccefb9276bd09489b506
parent3a2ca60d6a7540d631df90807275da0ff25eca04 (diff)
downloadcurl-bagder/configure-writable-argv.tar.gz
configure: repair the check if argv can be written tobagder/configure-writable-argv
Due to bad escaping of the test code, the test wouldn't build and thus result in a negative test result, which would lead to the unconditional assumption that overwriting the arguments doesn't work and thus curl would never hide credentials given in the command line, even when it would otherwise be possible. Regression from commit 2d4c2152c Reported-by: huzunhao on github Fixes #5470
-rwxr-xr-xconfigure.ac12
1 files changed, 7 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 0c1decc72..8161eee94 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1282,12 +1282,14 @@ dnl Check if the operating system allows programs to write to their own argv[]
dnl **********************************************************************
AC_MSG_CHECKING([if argv can be written to])
-CURL_RUN_IFELSE([
-int main(int argc, char ** argv) {
- argv[0][0] = ' ';
- return (argv[0][0] == ' ')?0:1;
+CURL_RUN_IFELSE([[
+int main(int argc, char **argv)
+{
+ (void)argc;
+ argv[0][0] = ' ';
+ return (argv[0][0] == ' ')?0:1;
}
-],[
+]],[
curl_cv_writable_argv=yes
],[
curl_cv_writable_argv=no