
*** /home/jaq/src/curl/curl-7.10.3.orig/configure.in	Sat Dec 21 02:54:24 2002
--- /home/jaq/src/curl/curl-7.10.3/configure.in	Wed Jan 29 09:44:30 2003
***************
*** 319,324 ****
--- 319,340 ----
  fi
  
  dnl **********************************************************************
+ dnl Check if the operating system allows programs to write to their own argv[]
+ dnl **********************************************************************
+ 
+ AC_MSG_CHECKING([if argv can be written to])
+ AC_TRY_RUN([
+ int main(int argc, char ** argv) {
+ 	argv[0][0] = ' ';
+ 	return (argv[0][0] == ' ');
+ }
+ 	],
+ 	AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
+ 	AC_MSG_RESULT(yes),
+ 	AC_MSG_RESULT(no)
+ )
+ 
+ dnl **********************************************************************
  dnl Check for the presence of Kerberos4 libraries and headers
  dnl **********************************************************************
  

*** /home/jaq/src/curl/curl-7.10.3.orig/src/main.c	Thu Jan  9 02:04:42 2003
--- /home/jaq/src/curl/curl-7.10.3/src/main.c	Tue Jan 28 15:09:29 2003
***************
*** 1627,1636 ****
--- 1627,1658 ----
      case 'u':
        /* user:password  */
        GetStr(&config->userpwd, nextarg);
+ #ifdef HAVE_WRITABLE_ARGV
+       /* now that GetStr has copied the contents of nextarg, wipe the next
+        * argument out so that the username:password isn't displayed in the
+        * system process list */
+       if (nextarg) {
+ 	  size_t len;
+ 
+ 	  len = strlen(nextarg);
+ 	  while (len)
+ 	      nextarg[--len] = ' ';
+       }
+ #endif
        break;
      case 'U':
        /* Proxy user:password  */
        GetStr(&config->proxyuserpwd, nextarg);
+ #ifdef HAVE_WRITABLE_ARGV
+       /* as above, hide the username password argument */
+       if (nextarg) {
+ 	  size_t len;
+ 
+ 	  len = strlen(nextarg);
+ 	  while (len)
+ 	      nextarg[--len] = ' ';
+       }
+ #endif
        break;
      case 'v':
        config->conf ^= CONF_VERBOSE; /* talk a lot */

