]> granicus.if.org Git - apache/commitdiff
truncate existing file if "-c" is used
authorBrian Pane <brianp@apache.org>
Sat, 14 Sep 2002 17:49:37 +0000 (17:49 +0000)
committerBrian Pane <brianp@apache.org>
Sat, 14 Sep 2002 17:49:37 +0000 (17:49 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96811 13f79535-47bb-0310-9956-ffa450edef68

support/htpasswd.c

index 4e1d03b2c39312c50627f82fd0672e088648eec3..986407870554385657acce7358c07a81104ec84c 100644 (file)
@@ -566,7 +566,7 @@ int main(int argc, const char * const argv[])
      * If we're not creating a new file, copy records from the existing
      * one to the temporary file until we find the specified user.
      */
-    if (existing_file) {
+    if (existing_file && !(mask & APHTP_NEWFILE)) {
         if (apr_file_open(&fpw, pwfilename, APR_READ | APR_BUFFERED,
                           APR_OS_DEFAULT, pool) != APR_SUCCESS) {
             apr_file_printf(errfile, "%s: unable to read file %s\n",