aboutsummaryrefslogtreecommitdiffstats
path: root/etc.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-11-05 15:56:11 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-11-05 15:56:11 +0000
commit825018b1ba393cdf28825d5b722b1bc8148882ae (patch)
tree98fbdc7decc17d0cde3aa70c9b752e18aaf89f7e /etc.c
parent[w3m-dev 03371] segmentation fault by large complex table. (diff)
downloadw3m-825018b1ba393cdf28825d5b722b1bc8148882ae.tar.gz
w3m-825018b1ba393cdf28825d5b722b1bc8148882ae.zip
[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 <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'etc.c')
-rw-r--r--etc.c11
1 files changed, 6 insertions, 5 deletions
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 <pwd.h>
#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);