From 825018b1ba393cdf28825d5b722b1bc8148882ae Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Tue, 5 Nov 2002 15:56:11 +0000 Subject: [w3m-dev 03373] setting form on loading * config.h.dist (PRE_FORM_FILE): added * configure (PRE_FORM_FILE): added * etc.c (openPasswdFile): define by openSecretFile() (openSecretFile): renamed, not static * file.c (loadGeneralFile): preFOrmUpdateBuffer() * fm.h (Buffer): add submit (pre_form_file): added * form.c (struct pre_form_item): added (struct pre_form): added (next_token): added (PreForm): added (add_pre_form): added (add_pre_form_item): added (loadPreForm): added (preFormUpdateBuffer): added * frame.c (renderFrame): add preFormUpdateBuffer() * main.c (MAIN): buf->submit check * proto.h (preFormUpdateBuffer): added (openSecretFile): added (loadPreForm): added * rc.c (sync_with_option): add loadPreForm() From: Hironori SAKAMOTO --- etc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'etc.c') diff --git a/etc.c b/etc.c index 13625a8..94e8e1f 100644 --- a/etc.c +++ b/etc.c @@ -1,4 +1,4 @@ -/* $Id: etc.c,v 1.28 2002/10/30 17:21:40 ukai Exp $ */ +/* $Id: etc.c,v 1.29 2002/11/05 15:56:12 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" @@ -1034,9 +1034,10 @@ parsePasswd(FILE * fp, int netrc) } #define PASS_IS_READABLE_MSG "SECURITY NOTE: passwd file must not be accessible by others" +#define openPasswdFile(fname) openSecretFile(fname, PASS_IS_READABLE_MSG) -static FILE * -openPasswdFile(char *fname) +FILE * +openSecretFile(char *fname, char *error_msg) { struct stat st; if (fname == NULL) @@ -1049,11 +1050,11 @@ openPasswdFile(char *fname) */ if ((st.st_mode & (S_IRWXG | S_IRWXO)) != 0) { if (fmInitialized) { - message(PASS_IS_READABLE_MSG, 0, 0); + message(error_msg, 0, 0); refresh(); } else { - fputs(PASS_IS_READABLE_MSG, stderr); + fputs(error_msg, stderr); fputc('\n', stderr); } sleep(2); -- cgit v1.2.3