summaryrefslogtreecommitdiffstats
path: root/support/htpasswd.c
diff options
context:
space:
mode:
authorBrian Pane <brianp@apache.org>2002-09-14 19:49:37 +0200
committerBrian Pane <brianp@apache.org>2002-09-14 19:49:37 +0200
commiteac90b66ed1db93f4dbc5848fc9364d79d5b4ccd (patch)
treeab4f5fed3d8a9286aeba368a78e4c0f38de70423 /support/htpasswd.c
parent Move another non-exists test into the non-existing tests block, and (diff)
downloadapache2-eac90b66ed1db93f4dbc5848fc9364d79d5b4ccd.tar.xz
apache2-eac90b66ed1db93f4dbc5848fc9364d79d5b4ccd.zip
truncate existing file if "-c" is used
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96811 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support/htpasswd.c')
-rw-r--r--support/htpasswd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/support/htpasswd.c b/support/htpasswd.c
index 4e1d03b2c3..9864078705 100644
--- a/support/htpasswd.c
+++ b/support/htpasswd.c
@@ -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",