aboutsummaryrefslogtreecommitdiffstats
path: root/g10/openfile.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2003-01-02 18:28:29 +0000
committerWerner Koch <[email protected]>2003-01-02 18:28:29 +0000
commit842e690f54fe32e0af5d34180c1b08c7882093b9 (patch)
tree485140a5d8f4ff4e31eccaef145701f7b4b3052d /g10/openfile.c
parent* getkey.c (merge_selfsigs_main), main.h, sig-check.c (diff)
downloadgnupg-842e690f54fe32e0af5d34180c1b08c7882093b9.tar.gz
gnupg-842e690f54fe32e0af5d34180c1b08c7882093b9.zip
* keydb.c (keydb_add_resource): Don't assume that try_make_homedir
terminates but check again for the existence of the directory and continue then. * openfile.c (copy_options_file): Print a warning if the skeleton file has active options.
Diffstat (limited to 'g10/openfile.c')
-rw-r--r--g10/openfile.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/g10/openfile.c b/g10/openfile.c
index 7ccd43a45..34be71d62 100644
--- a/g10/openfile.c
+++ b/g10/openfile.c
@@ -1,5 +1,5 @@
/* openfile.c
- * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -286,7 +286,6 @@ open_sigfile( const char *iname )
return a;
}
-
/****************
* Copy the option file skeleton to the given directory.
*/
@@ -299,6 +298,8 @@ copy_options_file( const char *destdir )
int linefeeds=0;
int c;
mode_t oldmask;
+ int esc = 0;
+ int any_option = 0;
if( opt.dry_run )
return;
@@ -327,12 +328,27 @@ copy_options_file( const char *destdir )
if( c == '\n' )
linefeeds++;
}
- else
+ else {
putc( c, dst );
+ if (c== '\n')
+ esc = 1;
+ else if (esc == 1) {
+ if (c == ' ' || c == '\t')
+ ;
+ else if (c == '#')
+ esc = 2;
+ else
+ any_option = 1;
+ }
+ }
}
fclose( dst );
fclose( src );
log_info(_("new configuration file `%s' created\n"), fname );
+ if (any_option)
+ log_info (_("WARNING: options in `%s'"
+ " are not yet active during this run\n"),
+ fname);
m_free(fname);
}