From: Brian Pane Date: Sat, 14 Sep 2002 17:49:37 +0000 (+0000) Subject: truncate existing file if "-c" is used X-Git-Tag: 2.0.42~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eac90b66ed1db93f4dbc5848fc9364d79d5b4ccd;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/support/htpasswd.c b/support/htpasswd.c index 4e1d03b2c39..98640787055 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",