aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog54
-rw-r--r--Makefile20
-rw-r--r--config.h.dist59
-rwxr-xr-xconfigure61
-rw-r--r--file.c6
-rw-r--r--fm.h4
-rw-r--r--indep.c24
-rw-r--r--indep.h5
-rw-r--r--local.c35
-rw-r--r--main.c25
-rw-r--r--rc.c35
-rw-r--r--terms.c19
-rw-r--r--url.c15
-rw-r--r--w3mbookmark.c27
-rw-r--r--w3mhelperpanel.c8
15 files changed, 204 insertions, 193 deletions
diff --git a/ChangeLog b/ChangeLog
index a8ce2a6..f19e6ac 100644
--- 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
index 651bea7..e2a476f 100644
--- 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
index 9a449bf..536cddd 100644
--- 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
index c976786..8f523cb 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: configure,v 1.9 2001/11/21 09:21:59 ukai Exp $
+# $Id: configure,v 1.10 2001/11/21 16:29:46 ukai Exp $
# Configuration.
#
@@ -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
index b104c73..666a1ac 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.9 2001/11/20 16:46:32 ukai Exp $ */
+/* $Id: file.c,v 1.10 2001/11/21 16:29:46 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -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
index a0f1356..b29d606 100644
--- a/fm.h
+++ b/fm.h
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.8 2001/11/21 09:09:10 ukai Exp $ */
+/* $Id: fm.h,v 1.9 2001/11/21 16:29:46 ukai Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -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
index 97c11db..a3ce9bd 100644
--- a/indep.c
+++ b/indep.c
@@ -1,4 +1,4 @@
-/* $Id: indep.c,v 1.5 2001/11/20 04:11:16 ukai Exp $ */
+/* $Id: indep.c,v 1.6 2001/11/21 16:29:46 ukai Exp $ */
#include "fm.h"
#include <stdio.h>
#include <pwd.h>
@@ -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
index 2517350..710608b 100644
--- a/indep.h
+++ b/indep.h
@@ -1,4 +1,4 @@
-/* $Id: indep.h,v 1.4 2001/11/20 17:49:23 ukai Exp $ */
+/* $Id: indep.h,v 1.5 2001/11/21 16:29:46 ukai Exp $ */
#ifndef INDEP_H
#define INDEP_H
#include "gc.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
index b4484ac..1777d5d 100644
--- a/local.c
+++ b/local.c
@@ -1,4 +1,4 @@
-/* $Id: local.c,v 1.6 2001/11/20 17:49:23 ukai Exp $ */
+/* $Id: local.c,v 1.7 2001/11/21 16:29:46 ukai Exp $ */
#include "fm.h"
#include <string.h>
#include <stdio.h>
@@ -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
index a2dd0da..a0cfd89 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.12 2001/11/21 04:29:14 a-ito Exp $ */
+/* $Id: main.c,v 1.13 2001/11/21 16:29:46 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -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
index 63261bb..95447b1 100644
--- a/rc.c
+++ b/rc.c
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.5 2001/11/20 17:49:23 ukai Exp $ */
+/* $Id: rc.c,v 1.6 2001/11/21 16:29:47 ukai Exp $ */
/*
* Initialization file etc.
*/
@@ -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
index 4c488d8..f494fe7 100644
--- a/terms.c
+++ b/terms.c
@@ -1,4 +1,4 @@
-/* $Id: terms.c,v 1.10 2001/11/21 09:09:10 ukai Exp $ */
+/* $Id: terms.c,v 1.11 2001/11/21 16:29:47 ukai Exp $ */
/*
* An original curses library for EUC-kanji by Akinori ITO, December 1989
* revised by Akinori ITO, January 1995
@@ -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
index 912235b..68e9d71 100644
--- a/url.c
+++ b/url.c
@@ -1,4 +1,4 @@
-/* $Id: url.c,v 1.6 2001/11/20 17:49:23 ukai Exp $ */
+/* $Id: url.c,v 1.7 2001/11/21 16:29:47 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include <sys/socket.h>
@@ -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
index d8ab0e3..2d0191c 100644
--- a/w3mbookmark.c
+++ b/w3mbookmark.c
@@ -1,4 +1,4 @@
-/* $Id: w3mbookmark.c,v 1.3 2001/11/20 17:49:23 ukai Exp $ */
+/* $Id: w3mbookmark.c,v 1.4 2001/11/21 16:29:47 ukai Exp $ */
#ifdef __EMX__
#include <stdlib.h>
#endif
@@ -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
index 7554dc5..ab7e145 100644
--- a/w3mhelperpanel.c
+++ b/w3mhelperpanel.c
@@ -1,4 +1,4 @@
-/* $Id: w3mhelperpanel.c,v 1.4 2001/11/20 17:49:23 ukai Exp $ */
+/* $Id: w3mhelperpanel.c,v 1.5 2001/11/21 16:29:47 ukai Exp $ */
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
@@ -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",