You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Havard <br...@kheldar.apana.org.au> on 1998/01/20 14:41:53 UTC

[PATCH] PR#1482: htpasswd fails to add users in OS/2 and probably Win32

Here's a fix for the problem described in PR#1482. Pretty simple really, "cp"
becomes "copy" and the parameters are quoted so forward slashes aren't
interpreted as switches.

As Win32 doesn't have 'cp' either I've included it in the #ifdef, not tested
though (I don't have MSC).

Note, though that you have to tweak the makefile in the support directory to
build support programs for OS/2 (add .exe suffix, change -lap to -llibap).
I'll see if I can come up with a generic fix for this.

Index: src/support/htpasswd.c
===================================================================
RCS file: /cvs/apachen/src/support/htpasswd.c,v
retrieving revision 1.9
diff -u -w -r1.9 htpasswd.c
--- htpasswd.c	1998/01/20 01:55:25	1.9
+++ htpasswd.c	1998/01/20 12:26:02
@@ -215,7 +215,11 @@
     }
     fclose(f);
     fclose(tfp);
+#if defined(__EMX__) || defined(WIN32)
+    sprintf(command, "copy \"%s\" \"%s\"", tn, argv[1]);
+#else
     sprintf(command, "cp %s %s", tn, argv[1]);
+#endif
     system(command);
     unlink(tn);
     exit(0);

--
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Re: [PATCH] PR#1482: htpasswd fails to add users in OS/2 and probably Win32

Posted by Dean Gaudet <dg...@arctic.org>.
+1

Dean

On Tue, 20 Jan 1998, Brian Havard wrote:

> Here's a fix for the problem described in PR#1482. Pretty simple really, "cp"
> becomes "copy" and the parameters are quoted so forward slashes aren't
> interpreted as switches.
> 
> As Win32 doesn't have 'cp' either I've included it in the #ifdef, not tested
> though (I don't have MSC).
> 
> Note, though that you have to tweak the makefile in the support directory to
> build support programs for OS/2 (add .exe suffix, change -lap to -llibap).
> I'll see if I can come up with a generic fix for this.
> 
> Index: src/support/htpasswd.c
> ===================================================================
> RCS file: /cvs/apachen/src/support/htpasswd.c,v
> retrieving revision 1.9
> diff -u -w -r1.9 htpasswd.c
> --- htpasswd.c	1998/01/20 01:55:25	1.9
> +++ htpasswd.c	1998/01/20 12:26:02
> @@ -215,7 +215,11 @@
>      }
>      fclose(f);
>      fclose(tfp);
> +#if defined(__EMX__) || defined(WIN32)
> +    sprintf(command, "copy \"%s\" \"%s\"", tn, argv[1]);
> +#else
>      sprintf(command, "cp %s %s", tn, argv[1]);
> +#endif
>      system(command);
>      unlink(tn);
>      exit(0);
> 
> --
>  ______________________________________________________________________________
>  |  Brian Havard                 |  "He is not the messiah!                   |
>  |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
>  ------------------------------------------------------------------------------
> 
>