commit 08d1f734f712c816ced230fe1e5207e023855788
parent c84fd1b3bdac45d42c1d45b95f6c46f18f861351
Author: ukai <ukai>
Date: Wed, 21 Nov 2001 16:29:46 +0000
[w3m-dev 02479] #ifdef cleanups
make -> $(MAKE)
Diffstat:
15 files changed, 192 insertions(+), 181 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,5 +1,59 @@
2001-11-21 Fumitoshi UKAI <ukai@debian.or.jp>
+ [w3m-dev 02479]
+ * rc.c (init_rc): remove #ifdef __EMX__ for tmpdir
+ * config.h.dit: updated
+ * url.c (openURL): use CGI_EXTENSION
+ add extlen
+ * rc.c (helpFile): remove #ifdef __EMX__
+ use w3m_help_dir()
+ * w3mbookmark.c (lib_dir): removed
+ * w3mbookmark.c (print_bookmark_panel): use w3m_lib_dir()
+ * rc.c (libFile): remove #ifdef __EMX__
+ use w3m_lib_dir()
+ * local.c (get_os2_dft): removed
+ * local.c (check_local_cgi): use w3m_lib_dir() instead of lib_dir
+ * local.c (cgi_filename): ditto
+ * indep.c (w3m_dir): added
+ * indep.c (w3m_lib_dir w3m_help_dir): ditto
+ * indep.h (w3m_lib_dir w3m_help_dir): ditto
+ * terms.c (set_tty): remove #ifdef __EMX__
+ use DEV_TTY_PATH
+ * local.c (localcgi_get): use DEV_NULL_PATH
+ * w3mhelperpanel.c (printMailcapPanal): remove #ifdef __EMX__
+ use W3mHELPERPANEL_CMDNAME
+ * rc.c (optionpanel_src1): ditto
+ * w3mbookmark.c (bkmark_src1): remove #ifdef __EMX__
+ use W3MBOOKMARK_CMDNAME
+ * main.c (adBmark): ditto
+ use w3m_lib_dir()
+ * terms.c (getTCstr): remove #ifdef __DJGPP__
+ use DEFAULT_TERM
+ check ent is NULL
+ * main.c (fusage): remove #ifdef SHOW_PARAMS
+ * main.c (MAIN): ditto
+ * rc.c (show_params): ditto
+ * fm.h (view_unseenobject): remove #ifdef VIEW_UNSEENOBJECTS
+ * url.c (check_no_proxy): remove #ifdef NOPROXY_NETADDR
+ * configure (show_params): removed
+ * configure (config.h):
+ - fix comment for USE_MARK
+ - add MENU_THIN_FRAME
+ - move $def_nntp (USE_NNTP), $def_ansi_color (ANSI_COLOR)
+ - remove VIEW_UNSEENOBJECTS
+ - remove $def_show_params (SHOW_PARAMS)
+ - define DEFAULT_TERM
+ - define W3MBOOKMARK_CMDNAME
+ - define W3MHELPERPANEL_CMDNAME
+ - define DEV_NULL_PATH
+ - define DEV_TTY_PATH
+ - define CGI_EXTENSION
+
+ [w3m-dev 02478]
+ * Makefile: make -> $(MAKE)
+
+2001-11-21 Fumitoshi UKAI <ukai@debian.or.jp>
+
* [w3m-dev 02473]
* scripts/Makefile: chmod +x
* scripts/Makefile: add clean target
diff --git a/Makefile b/Makefile
@@ -1,29 +1,29 @@
GCLIBTGZ=gc5.0alpha3.tar.gz
all: XXMakefile
- make -f XXMakefile
+ $(MAKE) -f XXMakefile
install: XXMakefile
- make -f XXMakefile install
+ $(MAKE) -f XXMakefile install
install-scripts: XXMakefile
- make -f XXMakefile install-scripts
+ $(MAKE) -f XXMakefile install-scripts
uninstall: XXMakefile
- make -f XXMakefile uninstall
+ $(MAKE) -f XXMakefile uninstall
proto: XXMakefile
- make -f XXMakefile proto
+ $(MAKE) -f XXMakefile proto
clean: XXMakefile
- make -f XXMakefile clean
+ $(MAKE) -f XXMakefile clean
sweep: XXMakefile
- make -f XXMakefile sweep
+ $(MAKE) -f XXMakefile sweep
veryclean: clean sweep
rm XXMakefile
- (cd gc; make clean)
+ (cd gc; $(MAKE) clean)
rm -f config.param
rm -f */*~ */*.orig */*.rej
@@ -33,10 +33,10 @@ prepare:
cp XMakefile.dist XMakefile
dist: XXMakefile
- make -f XXMakefile dist
+ $(MAKE) -f XXMakefile dist
bindist: XXMakefile
- make -f XXMakefile bindist
+ $(MAKE) -f XXMakefile bindist
indent:
indent -orig -nce -ncdb -i4 -di1 -nbc *.c *.h
diff --git a/config.h.dist b/config.h.dist
@@ -15,8 +15,8 @@
#undef DICT
/*
- If you define USE_MARK, you can use set-mark (C-SPC),
- goto-next-mark (ESC p), goto-next-mark (ESC n) and
+ If you define USE_MARK, you can use set-mark MARK (C-SPC),
+ goto-prev-mark PREV_MARK (ESC p), goto-next-mark NEXT_MARK (ESC n) and
mark-by-regexp (").
*/
#undef USE_MARK
@@ -32,12 +32,6 @@
#define BG_COLOR
/*
- VIEW_UNSEENOBJECTS enables w3m to make a link to unseen objects.
- e.g. background image.
- */
-#undef VIEW_UNSEENOBJECTS
-
-/*
VI_PREC_NUM enables vi-like behavior for '2 SPC' or '2 b'
*/
#undef VI_PREC_NUM
@@ -53,16 +47,6 @@
#undef USE_GOPHER
/*
- * Support NNTP
- */
-#undef USE_NNTP
-
-/*
- * Support ANSI color escape sequences
- */
-#undef ANSI_COLOR
-
-/*
* Enable id attribute
*/
#define ID_EXT
@@ -97,6 +81,16 @@
*/
#undef NEXTPAGE_TOPLINE
+/*
+ * Use alarm function.
+ */
+#undef USE_ALARM
+
+/*
+ * thin chars for menu frame
+ */
+#undef MENU_THIN_FRAME
+
/**********************************************************/
#ifdef makefile_parameter
@@ -143,7 +137,8 @@ MODEL=Linux.i686-monster-ja
#define USE_SSL
#undef USE_SSL_VERIFY
#undef FTPPASS_HOSTNAMEGEN
-#undef SHOW_PARAMS
+#undef USE_NNTP
+#undef ANSI_COLOR
#define DEF_EDITOR "/bin/vi"
#define DEF_MAILER "/bin/mail"
@@ -188,6 +183,8 @@ MODEL=Linux.i686-monster-ja
#define HAVE_PUTENV
#define HAVE_SRAND48
#define HAVE_SRANDOM
+#undef HAVE_GETPASSPHRASE
+
#define SETJMP(env) sigsetjmp(env,1)
#define LONGJMP(env,val) siglongjmp(env,val)
@@ -228,6 +225,30 @@ typedef void MySignalHandler;
#define SUPPORT_DOS_DRIVE_PREFIX 1
#endif
+#if defined( __CYGWIN__ )
+#define SUPPORT_NETBIOS_SHARE 1
+#endif
+
+#if defined(__DJGPP__)
+#define DEFAULT_TERM "dosansi"
+#else
+#define DEFAULT_TERM 0 /* XXX */
+#endif
+
+#if defined(__EMX__) /* use $extension? */
+#define W3MBOOKMARK_CMDNAME "w3mbookmark.exe"
+#define W3MHELPERPANEL_CMDNAME "w3mhelperpanel.exe"
+#define DEV_NULL_PATH "nul"
+#define DEV_TTY_PATH "con"
+#define CGI_EXTENSION ".cmd"
+#else
+#define W3MBOOKMARK_CMDNAME "w3mbookmark"
+#define W3MHELPERPANEL_CMDNAME "w3mhelperpanel"
+#define DEV_NULL_PATH "/dev/null"
+#define DEV_TTY_PATH "/dev/tty"
+#define CGI_EXTENSION ".cgi"
+#endif
+
#endif /* makefile_parameter */
#endif /* _CONFIGURED_ */
diff --git a/configure b/configure
@@ -447,15 +447,6 @@ else
def_ftppass_hostnamegen="#undef FTPPASS_HOSTNAMEGEN"
fi
-echo "Do you want listing of options"
-yesno show_params "$show_params" n
-echo "show_params=$show_params" >> config.param
-if [ "$show_params" = y ]; then
- def_show_params="#define SHOW_PARAMS"
-else
- def_show_params="#undef SHOW_PARAMS"
-fi
-
echo "Do you want NNTP support"
yesno use_nntp "$use_nntp" n
echo "use_nntp=$use_nntp" >> config.param
@@ -1705,8 +1696,8 @@ cat > config.h << END_OF_CONFIG_H
#undef DICT
/*
- If you define USE_MARK, you can use set-mark (C-SPC),
- goto-next-mark (ESC p), goto-next-mark (ESC n) and
+ If you define USE_MARK, you can use set-mark MARK (C-SPC),
+ goto-prev-mark PREV_MARK (ESC p), goto-next-mark NEXT_MARK (ESC n) and
mark-by-regexp (").
*/
#undef USE_MARK
@@ -1722,12 +1713,6 @@ cat > config.h << END_OF_CONFIG_H
#define BG_COLOR
/*
- VIEW_UNSEENOBJECTS enables w3m to make a link to unseen objects.
- e.g. background image.
- */
-#undef VIEW_UNSEENOBJECTS
-
-/*
VI_PREC_NUM enables vi-like behavior for '2 SPC' or '2 b'
*/
#undef VI_PREC_NUM
@@ -1743,16 +1728,6 @@ cat > config.h << END_OF_CONFIG_H
#undef USE_GOPHER
/*
- * Support NNTP
- */
-$def_use_nntp
-
-/*
- * Support ANSI color escape sequences
- */
-$def_ansi_color
-
-/*
* Enable id attribute
*/
#define ID_EXT
@@ -1788,10 +1763,15 @@ $def_ansi_color
#undef NEXTPAGE_TOPLINE
/*
- Use alarm function.
+ * Use alarm function.
*/
#undef USE_ALARM
+/*
+ * thin chars for menu frame
+ */
+#undef MENU_THIN_FRAME
+
/**********************************************************/
#ifdef makefile_parameter
@@ -1838,7 +1818,8 @@ $def_cookie
$def_ssl
$def_use_ssl_verify
$def_ftppass_hostnamegen
-$def_show_params
+$def_use_nntp
+$def_ansi_color
#define DEF_EDITOR "$editor"
#define DEF_MAILER "$mailer"
@@ -1929,6 +1910,26 @@ $no_float_h
#define SUPPORT_NETBIOS_SHARE 1
#endif
+#if defined(__DJGPP__)
+#define DEFAULT_TERM "dosansi"
+#else
+#define DEFAULT_TERM 0 /* XXX */
+#endif
+
+#if defined(__EMX__) /* use \$extension? */
+#define W3MBOOKMARK_CMDNAME "w3mbookmark.exe"
+#define W3MHELPERPANEL_CMDNAME "w3mhelperpanel.exe"
+#define DEV_NULL_PATH "nul"
+#define DEV_TTY_PATH "con"
+#define CGI_EXTENSION ".cmd"
+#else
+#define W3MBOOKMARK_CMDNAME "w3mbookmark"
+#define W3MHELPERPANEL_CMDNAME "w3mhelperpanel"
+#define DEV_NULL_PATH "/dev/null"
+#define DEV_TTY_PATH "/dev/tty"
+#define CGI_EXTENSION ".cgi"
+#endif
+
#endif /* makefile_parameter */
#endif /* _CONFIGURED_ */
diff --git a/file.c b/file.c
@@ -3614,7 +3614,6 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
case HTML_N_FONT:
case HTML_NOP:
return 1;
-#ifdef VIEW_UNSEENOBJECTS
case HTML_BGSOUND:
if (view_unseenobject) {
if (parsedtag_get_value(tag, ATTR_SRC, &p)) {
@@ -3645,9 +3644,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
}
}
return 1;
-#endif /* VIEW_UNSEENOBJECTS */
case HTML_BODY:
-#ifdef VIEW_UNSEENOBJECTS
if (view_unseenobject) {
if (parsedtag_get_value(tag, ATTR_BACKGROUND, &p)) {
Str s;
@@ -3657,7 +3654,6 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
HTMLlineproc1(s->ptr, h_env);
}
}
-#endif /* VIEW_UNSEENOBJECTS */
case HTML_N_BODY:
obuf->flag |= RB_IGNORE_P;
return 1;
diff --git a/fm.h b/fm.h
@@ -803,9 +803,7 @@ global TextList *Cookie_reject_domains;
global TextList *Cookie_accept_domains;
#endif /* USE_COOKIE */
-#ifdef VIEW_UNSEENOBJECTS
global int view_unseenobject init(TRUE);
-#endif /* VIEW_UNSEENOBJECTS */
#if defined(USE_SSL) && defined(USE_SSL_VERIFY)
global int ssl_verify_server init(FALSE);
diff --git a/indep.c b/indep.c
@@ -658,6 +658,28 @@ shell_quote(char *str)
return str;
}
+static char*
+w3m_dir(const char *name, char *dft)
+{
+#ifdef USE_PATH_ENVVAR
+ char *value = getenv(name);
+ return value ? value : dft;
+#else
+ return dft;
+#endif
+}
+
+char *
+w3m_lib_dir()
+{
+ return w3m_dir("W3M_LIB_DIR", LIB_DIR);
+}
+
+char *
+w3m_help_dir()
+{
+ return w3m_dir("W3M_HELP_DIR", HELP_DIR);
+}
/* Local Variables: */
/* c-basic-offset: 4 */
/* tab-width: 8 */
diff --git a/indep.h b/indep.h
@@ -39,6 +39,9 @@ extern Str Str_form_quote(Str x);
extern Str Str_form_unquote(Str x);
extern char *shell_quote(char *str);
+extern char *w3m_lib_dir();
+extern char *w3m_help_dir();
+
#define New(type) ((type*)GC_MALLOC(sizeof(type)))
#define NewAtom(type) ((type*)GC_MALLOC_ATOMIC(sizeof(type)))
#define New_N(type,n) ((type*)GC_MALLOC((n)*sizeof(type)))
diff --git a/local.c b/local.c
@@ -10,7 +10,7 @@
#include <unistd.h>
#endif /* HAVE_READLINK */
#ifdef __EMX__
-#include <limits.h>
+#include <limits.h> /* _MAX_PATH ? */
#endif /* __EMX__ */
#include "local.h"
@@ -153,19 +153,6 @@ dirBuffer(char *dname)
return buf;
}
-#ifdef __EMX__
-char *
-get_os2_dft(const char *name, char *dft)
-{
- char *value = getenv(name);
- return value ? value : dft;
-}
-
-#define lib_dir get_os2_dft("W3M_LIB_DIR",LIB_DIR)
-#else /* not __EMX__ */
-#define lib_dir LIB_DIR
-#endif /* not __EMX__ */
-
static int
check_local_cgi(char *file, int status)
{
@@ -182,9 +169,9 @@ check_local_cgi(char *file, int status)
char tmp[_MAX_PATH];
int len;
- _abspath(tmp, lib_dir, _MAX_PATH); /* Translate '\\' to '/'
- *
- */
+ _abspath(tmp, w3m_lib_dir(), _MAX_PATH); /* Translate '\\' to '/'
+ *
+ */
len = strlen(tmp);
while (len > 1 && tmp[len-1] == '/')
len--;
@@ -194,7 +181,7 @@ check_local_cgi(char *file, int status)
}
#else /* not __EMX__ */
if (CGIFN_MODE(status) != CGIFN_CGIBIN) {
- char *tmp = Strnew_charp(lib_dir)->ptr;
+ char *tmp = Strnew_charp(w3m_lib_dir())->ptr;
int len = strlen(tmp);
while (len > 1 && tmp[len-1] == '/')
@@ -318,7 +305,7 @@ cgi_filename(char *fn, int *status)
}
if (strncmp(fn, "/$LIB/", 6) == 0) {
*status = CGIFN_NORMAL;
- tmp = Strnew_charp(lib_dir);
+ tmp = Strnew_charp(w3m_lib_dir());
fn += 5;
if (strchr(fn+1,'/'))
*status |= CGIFN_CONTAIN_SLASH;
@@ -444,7 +431,7 @@ localcgi_post(char *uri, char *qstr, FormList * request, char *referer)
}
fclose(f1);
freopen( tmp1->ptr, "r", stdin);
-#ifndef __EMX__
+#ifndef __EMX__ /* ifndef HAVE_CHDIR? */
chdir(mydirname(file));
#endif
execl(file, mybasename(file), NULL);
@@ -479,10 +466,8 @@ localcgi_get(char *uri, char *request, char *referer)
set_environ("HTTP_REFERER",referer);
set_environ("REQUEST_METHOD", "GET");
set_environ("QUERY_STRING", request);
-#ifdef __EMX__
- freopen("nul", "r", stdin);
-#else
- freopen("/dev/null", "r", stdin);
+ freopen(DEV_NULL_PATH, "r", stdin);
+#ifndef __EMX__ /* #ifdef HAVE_CHDIR? */
chdir(mydirname(file));
#endif
execl(file, mybasename(file), NULL);
diff --git a/main.c b/main.c
@@ -63,10 +63,8 @@ static void keyPressEventProc(int c);
#ifdef USE_MARK
static void cmd_mark(Lineprop * p);
#endif /* USE_MARK */
-#ifdef SHOW_PARAMS
int show_params_p = 0;
void show_params(FILE * fp);
-#endif
static int display_ok = FALSE;
static void dump_source(Buffer *);
@@ -147,10 +145,8 @@ fusage(FILE *f, int err)
fprintf(f, " -o opt=value assign value to config option\n");
fprintf(f, " -config file specify config file\n");
fprintf(f, " -debug DO NOT USE\n");
-#ifdef SHOW_PARAMS
if (show_params_p)
show_params(f);
-#endif
exit(err);
}
@@ -554,24 +550,15 @@ MAIN(int argc, char **argv, char **envp)
else if (!strcmp("-X", argv[i]))
Do_not_use_ti_te = TRUE;
else if (!strcmp("-o", argv[i])) {
-#ifdef SHOW_PARAMS
if (++i >= argc || !strcmp(argv[i], "?")) {
show_params_p = 1;
usage();
}
-#else
- if (++i >= argc)
- usage();
-#endif
if (!set_param_option(argv[i])) {
/* option set failed */
fprintf(stderr, "%s: bad option\n", argv[i]);
-#ifdef SHOW_PARAMS
show_params_p = 1;
usage();
-#else
- exit(1);
-#endif
}
option_assigned = 1;
}
@@ -3494,13 +3481,9 @@ adBmark(void)
{
Str tmp;
-#ifdef __EMX__
- tmp = Sprintf("file://%s/w3mbookmark.exe?mode=panel&bmark=%s&url=%s&title=%s",
- get_os2_dft("W3M_LIB_DIR", LIB_DIR),
-#else /* not __EMX__ */
- tmp = Sprintf("file://%s/w3mbookmark?mode=panel&bmark=%s&url=%s&title=%s",
- LIB_DIR,
-#endif /* not __EMX__ */
+ tmp = Sprintf("file://%s/" W3MBOOKMARK_CMDNAME
+ "?mode=panel&bmark=%s&url=%s&title=%s",
+ w3m_lib_dir(),
(Str_form_quote(Strnew_charp(BookmarkFile)))->ptr,
(Str_form_quote(parsedURL2Str(&Currentbuf->currentURL)))->ptr,
(Str_form_quote(Strnew_charp(Currentbuf->buffername)))->ptr);
diff --git a/rc.c b/rc.c
@@ -607,7 +607,6 @@ search_param(char *name)
return NULL;
}
-#ifdef SHOW_PARAMS
void
show_params(FILE * fp)
{
@@ -675,7 +674,6 @@ show_params(FILE * fp)
}
}
}
-#endif
int
str_to_bool(char *value, int old)
@@ -1069,16 +1067,12 @@ init_rc(char *config_file)
{
struct stat st;
FILE *f;
-#ifndef __EMX__ /* jsawa */
- char *tmpdir = "/tmp";
-#else
char *tmpdir;
- if ( (tmpdir = getenv("TMP")) == NULL || *tmpdir == '\0' )
- if ( (tmpdir = getenv("TEMP")) == NULL || *tmpdir == '\0' )
- if ( (tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0' )
- *tmpdir = "/tmp";
-#endif /* __EMX__ */
+ if (((tmpdir = getenv("TMP")) == NULL || *tmpdir == '\0')
+ && ((tmpdir = getenv("TEMP")) == NULL || *tmpdir == '\0')
+ && ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0'))
+ tmpdir = "/tmp";
if (rc_initialized)
return;
@@ -1129,11 +1123,7 @@ init_rc(char *config_file)
static char optionpanel_src1[] =
"<html><head><title>Option Setting Panel</title></head>\
<body><center><b>Option Setting Panel</b><br><b>(w3m version %s)</b></center><p>\n"
-#ifdef __EMX__
-"<a href=\"file:///$LIB/w3mhelperpanel.exe?mode=panel\">%s</a>\n"
-#else /* not __EMX__ */
-"<a href=\"file:///$LIB/w3mhelperpanel?mode=panel\">%s</a>\n"
-#endif /* not __EMX__ */
+"<a href=\"file:///$LIB/" W3MHELPERPANEL_CMDNAME "?mode=panel\">%s</a>\n"
"<form method=internal action=option>";
static Str
@@ -1289,12 +1279,7 @@ rcFile(char *base)
char *
libFile(char *base)
{
-#ifdef __EMX__
- Str file = Strnew_charp(get_os2_dft("W3M_LIB_DIR", LIB_DIR));
-#else
- Str file = Strnew_charp(LIB_DIR);
-#endif /* __EMX__ */
-
+ Str file = Strnew_charp(w3m_lib_dir());
Strcat_char(file, '/');
Strcat_charp(file, base);
return expandName(file->ptr);
@@ -1303,11 +1288,7 @@ libFile(char *base)
char *
helpFile(char *base)
{
-#ifdef __EMX__
- Str file = Strnew_charp(get_os2_dft("W3M_HELP_DIR", HELP_DIR));
-#else /* not __EMX__ */
- Str file = Strnew_charp(HELP_DIR);
-#endif /* not __EMX__ */
+ Str file = Strnew_charp(w3m_help_dir());
Strcat_char(file, '/');
Strcat_charp(file, base);
return expandName(file->ptr);
diff --git a/terms.c b/terms.c
@@ -237,11 +237,7 @@ set_tty(void)
if (isatty(0)) /* stdin */
ttyn = ttyname(0);
else
-#ifndef __EMX__
- ttyn = "/dev/tty";
-#else /* __EMX__ */
- ttyn = "con";
-#endif /* __EMX__ */
+ ttyn = DEV_TTY_PATH;
tty = open(ttyn, O_RDWR);
if (tty < 0) {
/* use stderr instead of stdin... is it OK???? */
@@ -413,11 +409,12 @@ getTCstr(void)
char *pt = funcstr;
int r;
-#ifdef __DJGPP__
- ent = getenv("TERM") ? getenv("TERM") : "dosansi";
-#else
- ent = getenv("TERM");
-#endif /* __DJGPP__ */
+ ent = getenv("TERM") ? getenv("TERM") : DEFAULT_TERM;
+ if (ent == NULL) {
+ fprintf(stderr, "TERM is not set\n");
+ reset_exit(SIGNAL_ARGLIST);
+ }
+
r = tgetent(bp, ent);
if (r != 1) {
/* Can't find termcap entry */
diff --git a/url.c b/url.c
@@ -31,8 +31,6 @@
#define write(a,b,c) write_s(a,b,c)
#endif /* __WATT32__ */
-#define NOPROXY_NETADDR /* allow IP address for no_proxy */
-
#ifdef INET6
/* see rc.c, "dns_order" and dnsorders[] */
int ai_family_order_table[3][3] =
@@ -1288,6 +1286,7 @@ openURL(char *url, ParsedURL * pu, ParsedURL * current,
char *r;
InputStream stream;
#endif /* USE_NNTP */
+ int extlen = strlen(CGI_EXTENSION);
if (ouf) {
uf = *ouf;
@@ -1362,12 +1361,8 @@ openURL(char *url, ParsedURL * pu, ParsedURL * current,
uf.is_cgi = TRUE;
uf.scheme = pu->scheme = SCM_LOCAL_CGI;
}
- else if ((i = strlen(pu->file)) > 4 &&
-#ifdef __EMX__
- !strncmp(pu->file + i - 4, ".cmd", 4))
-#else
- !strncmp(pu->file + i - 4, ".cgi", 4))
-#endif
+ else if ((i = strlen(pu->file)) > extlen &&
+ !strncmp(pu->file + i - extlen, CGI_EXTENSION, extlen))
{
/* lodal CGI: GET */
uf.stream = newFileStream(localcgi_get(pu->real_file, "",
@@ -1783,7 +1778,6 @@ check_no_proxy(char *domain)
if (domain_match(tl->ptr, domain))
return 1;
}
-#ifdef NOPROXY_NETADDR
if (!NOproxy_netaddr) {
return 0;
}
@@ -1860,7 +1854,6 @@ check_no_proxy(char *domain)
}
#endif /* INET6 */
}
-#endif /* NOPROXY_NETADDR */
return 0;
}
diff --git a/w3mbookmark.c b/w3mbookmark.c
@@ -14,11 +14,7 @@
#if LANG == JA
static char *bkmark_src1 = "<html><head><title>Bookmark Registration</title>\n\
<body><h1>ブックマークの登録</h1>\n\n"
-#ifdef __EMX__
-"<form method=get action=\"file://%s/w3mbookmark.exe\">\n\n"
-#else
-"<form method=get action=\"file://%s/w3mbookmark\">\n\n"
-#endif
+"<form method=get action=\"file://%s/" W3MBOOKMARK_CMDNAME "\">\n\n"
"<input type=hidden name=mode value=register>\n\
<input type=hidden name=bmark value=\"%s\">\n\
<table cellpadding=0>\n";
@@ -35,11 +31,7 @@ static char *default_section = "未分
#else /* LANG != JA */
static char *bkmark_src1 = "<html><head><title>Bookmark Registration</title>\n\
<body><h1>Register to my bookmark</h1>\n\n"
-#ifdef __EMX__
-"<form method=get action=\"file://%s/w3mbookmark.exe\">\n\n"
-#else
-"<form method=get action=\"file://%s/w3mbookmark\">\n\n"
-#endif
+"<form method=get action=\"file://%s/" W3MBOOKMARK_CMDNAME "\">\n\n"
"<input type=hidden name=mode value=register>\n\
<input type=hidden name=bmark value=\"%s\">\n\
<table cellpadding=0>\n";
@@ -62,17 +54,6 @@ static char end_section[] = "<!--End of section (do not delete this comment)-->\
char *Local_cookie;
-#ifdef __EMX__
-static char *
-lib_dir()
-{
- char *value = getenv("W3M_LIB_DIR");
- return value ? value : LIB_DIR;
-}
-#else
-#define lib_dir() LIB_DIR
-#endif
-
void
print_bookmark_panel(char *bmark, char *url, char *title)
{
@@ -81,7 +62,7 @@ print_bookmark_panel(char *bmark, char *url, char *title)
char *p;
printf("Content-Type: text/html\n\n");
- printf(bkmark_src1, lib_dir(), bmark);
+ printf(bkmark_src1, w3m_lib_dir(), bmark);
if ((f = fopen(bmark, "r")) != NULL) {
printf("<tr><td>Section:<td><select name=\"section\">\n");
while (tmp = Strfgets(f), tmp->length > 0) {
diff --git a/w3mhelperpanel.c b/w3mhelperpanel.c
@@ -81,11 +81,7 @@ printMailcapPanel(char *mailcap)
}
printf("Content-Type: text/html\n\n");
printf("<html><head><title>External Viewer Setup</title></head><body><h1>%s</h1>\n", MSG_TITLE);
-#ifdef __EMX__
- printf("<form method=get action=\"file:///$LIB/w3mhelperpanel.exe\">\n");
-#else
- printf("<form method=get action=\"file:///$LIB/w3mhelperpanel\">\n");
-#endif
+ printf("<form method=get action=\"file:///$LIB/" W3MHELPERPANEL_CMDNAME "\">\n");
printf("<input type=hidden name=mode value=edit>\n");
printf("<input type=hidden name=cookie value=\"%s\">\n",local_cookie);
printf("%s: %s=<input type=text name=newtype><br>%s=<input type=text name=newcmd><br><input type=submit name=submit value=\"%s\">\n",