rewind to 10 Feb 2006.
This commit is contained in:
@@ -1,22 +1,3 @@
|
||||
2006-04-05 Dai Sato <satodai@w3m.jp>
|
||||
* [w3m-dev-en 01060] Some patches
|
||||
* fix many problems with w3m 0.5.1.
|
||||
* http://www.sic.med.tohoku.ac.jp/~satodai/w3m-dev-en/200511.month/1060.html
|
||||
* [w3m-dev 04150] vi_prec_num
|
||||
* main.c: fixed the switching on/off of vi-like prefix.
|
||||
* [w3m-dev 04151] Re: w3m -remote
|
||||
* acinclude.m4, aclocal.m4, config.h.in, configure, configure.ac, main.c, proto.h, terms.c:
|
||||
* added "-remote" option to receive commands from external processes.
|
||||
* [w3m-dev 04152] [PATCH] Add more explanation for the usage of the option setting panel.
|
||||
* doc/FAQ.html, doc-jp/FAQ.html, doc-jp/MANUAL.html: added some explanations.
|
||||
* [w3m-dev 04153] NEXT_LINK error
|
||||
* anchor.c, file.c, fm.h: fixed behavior of NEXT_LINK.
|
||||
* [w3m-dev 04154] Unclosed textarea in table
|
||||
* table.c: added handling </table> tag in textarea.
|
||||
* [w3m-dev 04155] w3m mingw patch
|
||||
* config.h, configure.ac, etc.c, file.c, ftp.c, indep.c, istream.c, local.c, main.c, rc.c, terms.c, url.c:
|
||||
* to compile on MingW. can't handle basic certification.
|
||||
|
||||
2006-02-10 Dai Sato <satodai@w3m.jp>
|
||||
|
||||
* http://dog.w3m.jp/bbs/spool/until200602.html#20060210153135@keijiwan
|
||||
@@ -8672,4 +8653,4 @@ a * [w3m-dev 03276] compile error on EWS4800
|
||||
* release-0-2-1
|
||||
* import w3m-0.2.1
|
||||
|
||||
$Id: ChangeLog,v 1.949 2006/04/05 14:18:53 inu Exp $
|
||||
$Id: ChangeLog,v 1.950 2006/04/07 13:21:11 inu Exp $
|
||||
|
||||
@@ -70,18 +70,6 @@ test x"$enable_mouse" = xyes && AC_DEFINE(USE_MOUSE)
|
||||
AC_MSG_RESULT($enable_mouse)])
|
||||
#
|
||||
# ----------------------------------------------------------------
|
||||
# AC_W3M_REMOTE
|
||||
# ----------------------------------------------------------------
|
||||
AC_DEFUN([AC_W3M_REMOTE],
|
||||
[AC_SUBST(USE_MOUSE)
|
||||
AC_MSG_CHECKING(if remote operation enabled)
|
||||
AC_ARG_ENABLE(remote,
|
||||
[ --disable-remote disable remote operation],,
|
||||
[enable_remote="yes"])
|
||||
test x"$enable_remote" = xyes && AC_DEFINE(USE_REMOTE)
|
||||
AC_MSG_RESULT($enable_remote)])
|
||||
#
|
||||
# ----------------------------------------------------------------
|
||||
# AC_W3M_COOKIE
|
||||
# ----------------------------------------------------------------
|
||||
AC_DEFUN([AC_W3M_COOKIE],
|
||||
@@ -889,27 +877,3 @@ AC_DEFUN([AC_W3M_SIGNAL],
|
||||
else
|
||||
AC_DEFINE(SIGNAL_RETURN,return 0)
|
||||
fi])
|
||||
#
|
||||
# ----------------------------------------------------------------
|
||||
# AC_W3M_SO_PEERCRED
|
||||
# ----------------------------------------------------------------
|
||||
AC_DEFUN([AC_W3M_SO_PEERCRED],
|
||||
[AC_SUBST(HAVE_SO_PEERCRED)
|
||||
AC_MSG_CHECKING(for SO_PEERCRED)
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/socket.h>],
|
||||
[ int sopt = SO_PEERCRED;
|
||||
exit(sopt);],
|
||||
[have_so_peercred="yes"; AC_DEFINE(HAVE_SO_PEERCRED)],
|
||||
[have_so_peercred="no"])
|
||||
AC_MSG_RESULT($have_so_peercred)])
|
||||
#
|
||||
# ----------------------------------------------------------------
|
||||
# AC_W3M_GETPEEREID
|
||||
# ----------------------------------------------------------------
|
||||
AC_DEFUN([AC_W3M_GETPEEREID],
|
||||
[AC_SUBST(HAVE_GETPEEREID)
|
||||
AC_MSG_CHECKING(for getpeereid)
|
||||
AC_CHECK_FUNC(getpeereid,
|
||||
[have_getpeereid="yes"; AC_DEFINE(HAVE_GETPEEREID)],
|
||||
[have_getpeereid="no"])])
|
||||
|
||||
Vendored
-37
@@ -82,18 +82,6 @@ test x"$enable_mouse" = xyes && AC_DEFINE(USE_MOUSE)
|
||||
AC_MSG_RESULT($enable_mouse)])
|
||||
#
|
||||
# ----------------------------------------------------------------
|
||||
# AC_W3M_REMOTE
|
||||
# ----------------------------------------------------------------
|
||||
AC_DEFUN([AC_W3M_REMOTE],
|
||||
[AC_SUBST(USE_MOUSE)
|
||||
AC_MSG_CHECKING(if remote operation enabled)
|
||||
AC_ARG_ENABLE(remote,
|
||||
[ --disable-remote disable remote operation],,
|
||||
[enable_remote="yes"])
|
||||
test x"$enable_remote" = xyes && AC_DEFINE(USE_REMOTE)
|
||||
AC_MSG_RESULT($enable_remote)])
|
||||
#
|
||||
# ----------------------------------------------------------------
|
||||
# AC_W3M_COOKIE
|
||||
# ----------------------------------------------------------------
|
||||
AC_DEFUN([AC_W3M_COOKIE],
|
||||
@@ -902,31 +890,6 @@ AC_DEFUN([AC_W3M_SIGNAL],
|
||||
AC_DEFINE(SIGNAL_RETURN,return 0)
|
||||
fi])
|
||||
|
||||
#
|
||||
# ----------------------------------------------------------------
|
||||
# AC_W3M_SO_PEERCRED
|
||||
# ----------------------------------------------------------------
|
||||
AC_DEFUN([AC_W3M_SO_PEERCRED],
|
||||
[AC_SUBST(HAVE_SO_PEERCRED)
|
||||
AC_MSG_CHECKING(for SO_PEERCRED)
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/socket.h>],
|
||||
[ int sopt = SO_PEERCRED;
|
||||
exit(sopt);],
|
||||
[have_so_peercred="yes"; AC_DEFINE(HAVE_SO_PEERCRED)],
|
||||
[have_so_peercred="no"])
|
||||
AC_MSG_RESULT($have_so_peercred)])
|
||||
#
|
||||
# ----------------------------------------------------------------
|
||||
# AC_W3M_GETPEEREID
|
||||
# ----------------------------------------------------------------
|
||||
AC_DEFUN([AC_W3M_GETPEEREID],
|
||||
[AC_SUBST(HAVE_GETPEEREID)
|
||||
AC_MSG_CHECKING(for getpeereid)
|
||||
AC_CHECK_FUNC(getpeereid,
|
||||
[have_getpeereid="yes"; AC_DEFINE(HAVE_GETPEEREID)],
|
||||
[have_getpeereid="no"])])
|
||||
|
||||
# lib-prefix.m4 serial 3 (gettext-0.13)
|
||||
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
|
||||
dnl This file is free software, distributed under the terms of the GNU
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: anchor.c,v 1.31 2006/04/05 14:18:53 inu Exp $ */
|
||||
/* $Id: anchor.c,v 1.32 2006/04/07 13:21:11 inu Exp $ */
|
||||
#include "fm.h"
|
||||
#include "myctype.h"
|
||||
#include "regex.h"
|
||||
@@ -175,8 +175,6 @@ searchAnchor(AnchorList *al, char *str)
|
||||
return NULL;
|
||||
for (i = 0; i < al->nanchor; i++) {
|
||||
a = &al->anchors[i];
|
||||
if (a->hseq < 0)
|
||||
continue;
|
||||
if (!strcmp(a->url, str))
|
||||
return a;
|
||||
}
|
||||
@@ -473,7 +471,6 @@ putHmarker(HmarkerList *ml, int line, int pos, int seq)
|
||||
}
|
||||
ml->marks[seq].line = line;
|
||||
ml->marks[seq].pos = pos;
|
||||
ml->marks[seq].invalid = 0;
|
||||
return ml;
|
||||
}
|
||||
|
||||
@@ -781,7 +778,7 @@ link_list_panel(Buffer *buf)
|
||||
al = buf->href;
|
||||
for (i = 0; i < al->nanchor; i++) {
|
||||
a = &al->anchors[i];
|
||||
if (a->hseq < 0 || a->slave)
|
||||
if (a->slave)
|
||||
continue;
|
||||
parseURL2(a->url, &pu, baseURL(buf));
|
||||
p = parsedURL2Str(&pu)->ptr;
|
||||
|
||||
-17
@@ -53,7 +53,6 @@
|
||||
#undef USE_MIGEMO
|
||||
#define USE_MARK
|
||||
#undef USE_MOUSE
|
||||
#undef USE_REMOTE
|
||||
#undef USE_GPM
|
||||
#undef USE_SYSMOUSE
|
||||
#undef USE_MENU
|
||||
@@ -144,8 +143,6 @@ typedef long clen_t;
|
||||
#undef HAVE_SETPGRP
|
||||
#undef HAVE_SETLOCALE
|
||||
#undef HAVE_LANGINFO_CODESET
|
||||
#undef HAVE_SO_PEERCRED
|
||||
#undef HAVE_GETPEEREID
|
||||
|
||||
#undef SETPGRP_VOID
|
||||
#ifdef HAVE_SETPGRP
|
||||
@@ -169,15 +166,9 @@ typedef RETSIGTYPE MySignalHandler;
|
||||
#define SIGNAL_RETURN @SIGNAL_RETURN@
|
||||
|
||||
#ifdef HAVE_SIGSETJMP
|
||||
#ifdef __MINGW32_VERSION
|
||||
# define SETJMP(env) setjmp(env)
|
||||
# define LONGJMP(env,val) longjmp(env, val)
|
||||
# define JMP_BUF jmp_buf
|
||||
#else
|
||||
# define SETJMP(env) sigsetjmp(env,1)
|
||||
# define LONGJMP(env,val) siglongjmp(env,val)
|
||||
# define JMP_BUF sigjmp_buf
|
||||
#endif /* __MINGW32_VERSION */
|
||||
#else
|
||||
# define SETJMP(env) setjmp(env)
|
||||
# define LONGJMP(env,val) longjmp(env)
|
||||
@@ -242,12 +233,4 @@ typedef RETSIGTYPE MySignalHandler;
|
||||
#define BUNZIP2_NAME "bunzip2"
|
||||
#define INFLATE_NAME "inflate"
|
||||
|
||||
#ifdef __MINGW32_VERSION
|
||||
#define SIGKILL SIGTERM
|
||||
#define S_IXGRP 0
|
||||
#define S_IXOTH 0
|
||||
#define S_IRWXG 0
|
||||
#define S_IRWXO 0
|
||||
#endif /* __MINGW32_VERSION */
|
||||
|
||||
#endif /* CONFIG_H_SEEN */
|
||||
|
||||
@@ -310,7 +310,7 @@ ac_includes_default="\
|
||||
# include <unistd.h>
|
||||
#endif"
|
||||
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION W3M W3M_LANG AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB PERL NKF MAN build build_cpu build_vendor build_os host host_cpu host_vendor host_os W3M_TARGET W3M_LIBS USE_M17N USE_UNICODE WCTARGET WCCFLAGS DISPLAY_CHARSET SYSTEM_CHARSET DOCUMENT_CHARSET POSUBST POLANG MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB INTLTARGET NLSTARGET USE_COLOR USE_ANSI_COLOR USE_BG_COLOR USE_IMAGE USE_W3MIMG_X11 USE_W3MIMG_FB W3MIMGDISPLAY_SETUID INSTALL_W3MIMGDISPLAY USE_GDKPIXBUF USE_GTK2 USE_IMLIB USE_IMLIB2 IMGTARGETS IMGOBJS IMGX11CFLAGS IMGX11LDFLAGS IMGFBCFLAGS IMGFBLDFLAGS USE_XFACE uncompface KEYMAP_FILE HELP_FILE KEYBIND USE_MENU USE_MOUSE USE_HISTORY USE_ALARM USE_COOKIE USE_DIGEST_AUTH USE_NNTP USE_GOPHER USE_DICT USE_HELP_CGI USE_EXTERNAL_URI_LOADER USE_W3MMAILER USE_MIGEMO DEF_MIGEMO_COMMAND DEF_EDITOR DEF_MAILER DEF_EXT_BROWSER INET6 HAVE_OLD_SS_FAMILY USE_SSL USE_SSL_VERIFY PKG_CONFIG SSL_CFLAGS SSL_LIBS USE_W3M USE_SYSMOUSE AUXBIN_TARGETS EGREP USE_BINMODE_STREAM HAVE_SYS_ERRLIST HAVE_SIGSETJMP RETSIGTYPE SIGNAL_RETURN HAVE_SO_PEERCRED HAVE_GETPEEREID HELP_DIR RC_DIR DOCDIRS CURRENT_VERSION LIBOBJS LTLIBOBJS'
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION W3M W3M_LANG AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB PERL NKF MAN build build_cpu build_vendor build_os host host_cpu host_vendor host_os W3M_TARGET W3M_LIBS USE_M17N USE_UNICODE WCTARGET WCCFLAGS DISPLAY_CHARSET SYSTEM_CHARSET DOCUMENT_CHARSET POSUBST POLANG MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB INTLTARGET NLSTARGET USE_COLOR USE_ANSI_COLOR USE_BG_COLOR USE_IMAGE USE_W3MIMG_X11 USE_W3MIMG_FB W3MIMGDISPLAY_SETUID INSTALL_W3MIMGDISPLAY USE_GDKPIXBUF USE_GTK2 USE_IMLIB USE_IMLIB2 IMGTARGETS IMGOBJS IMGX11CFLAGS IMGX11LDFLAGS IMGFBCFLAGS IMGFBLDFLAGS USE_XFACE uncompface KEYMAP_FILE HELP_FILE KEYBIND USE_MENU USE_MOUSE USE_HISTORY USE_ALARM USE_COOKIE USE_DIGEST_AUTH USE_NNTP USE_GOPHER USE_DICT USE_HELP_CGI USE_EXTERNAL_URI_LOADER USE_W3MMAILER USE_MIGEMO DEF_MIGEMO_COMMAND DEF_EDITOR DEF_MAILER DEF_EXT_BROWSER INET6 HAVE_OLD_SS_FAMILY USE_SSL USE_SSL_VERIFY PKG_CONFIG SSL_CFLAGS SSL_LIBS USE_W3M USE_SYSMOUSE AUXBIN_TARGETS EGREP USE_BINMODE_STREAM HAVE_SYS_ERRLIST HAVE_SIGSETJMP RETSIGTYPE SIGNAL_RETURN HELP_DIR RC_DIR DOCDIRS CURRENT_VERSION LIBOBJS LTLIBOBJS'
|
||||
ac_subst_files=''
|
||||
|
||||
# Initialize some variables set by options.
|
||||
@@ -866,7 +866,6 @@ Optional Features:
|
||||
--disable-mouse disable mouse operation
|
||||
--disable-history disable URL history
|
||||
--disable-alarm disable alarm
|
||||
--disable-remote disable remote operation
|
||||
--disable-cookie disable cookie
|
||||
--disable-digest-auth disable digest auth
|
||||
--disable-nntp disable NNTP
|
||||
@@ -5503,22 +5502,6 @@ fi
|
||||
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
|
||||
echo "$as_me:$LINENO: checking if remote operation enabled" >&5
|
||||
echo $ECHO_N "checking if remote operation enabled... $ECHO_C" >&6
|
||||
# Check whether --enable-remote or --disable-remote was given.
|
||||
if test "${enable_remote+set}" = set; then
|
||||
enableval="$enable_remote"
|
||||
|
||||
else
|
||||
enable_remote="yes"
|
||||
fi;
|
||||
test x"$enable_remote" = xyes && cat >>confdefs.h <<\_ACEOF
|
||||
#define USE_REMOTE 1
|
||||
_ACEOF
|
||||
|
||||
echo "$as_me:$LINENO: result: $enable_remote" >&5
|
||||
echo "${ECHO_T}$enable_remote" >&6
|
||||
|
||||
|
||||
echo "$as_me:$LINENO: checking if cookie is enabled" >&5
|
||||
echo $ECHO_N "checking if cookie is enabled... $ECHO_C" >&6
|
||||
@@ -10273,160 +10256,6 @@ _ACEOF
|
||||
|
||||
fi
|
||||
|
||||
echo "$as_me:$LINENO: checking for SO_PEERCRED" >&5
|
||||
echo $ECHO_N "checking for SO_PEERCRED... $ECHO_C" >&6
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#include <sys/socket.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int sopt = SO_PEERCRED;
|
||||
exit(sopt);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest.$ac_objext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
have_so_peercred="yes"; cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_SO_PEERCRED 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
have_so_peercred="no"
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
echo "$as_me:$LINENO: result: $have_so_peercred" >&5
|
||||
echo "${ECHO_T}$have_so_peercred" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking for getpeereid" >&5
|
||||
echo $ECHO_N "checking for getpeereid... $ECHO_C" >&6
|
||||
echo "$as_me:$LINENO: checking for getpeereid" >&5
|
||||
echo $ECHO_N "checking for getpeereid... $ECHO_C" >&6
|
||||
if test "${ac_cv_func_getpeereid+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
/* Define getpeereid to an innocuous variant, in case <limits.h> declares getpeereid.
|
||||
For example, HP-UX 11i <limits.h> declares gettimeofday. */
|
||||
#define getpeereid innocuous_getpeereid
|
||||
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char getpeereid (); below.
|
||||
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|
||||
<limits.h> exists even on freestanding compilers. */
|
||||
|
||||
#ifdef __STDC__
|
||||
# include <limits.h>
|
||||
#else
|
||||
# include <assert.h>
|
||||
#endif
|
||||
|
||||
#undef getpeereid
|
||||
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char getpeereid ();
|
||||
/* The GNU C library defines this for functions which it implements
|
||||
to always fail with ENOSYS. Some functions are actually named
|
||||
something starting with __ and the normal name is an alias. */
|
||||
#if defined (__stub_getpeereid) || defined (__stub___getpeereid)
|
||||
choke me
|
||||
#else
|
||||
char (*f) () = getpeereid;
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return f != getpeereid;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest$ac_exeext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_func_getpeereid=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_func_getpeereid=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_func_getpeereid" >&5
|
||||
echo "${ECHO_T}$ac_cv_func_getpeereid" >&6
|
||||
if test $ac_cv_func_getpeereid = yes; then
|
||||
have_getpeereid="yes"; cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_GETPEEREID 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
have_getpeereid="no"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
HELP_DIR="$datadir/$PACKAGE"
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
@@ -11213,8 +11042,6 @@ s,@HAVE_SYS_ERRLIST@,$HAVE_SYS_ERRLIST,;t t
|
||||
s,@HAVE_SIGSETJMP@,$HAVE_SIGSETJMP,;t t
|
||||
s,@RETSIGTYPE@,$RETSIGTYPE,;t t
|
||||
s,@SIGNAL_RETURN@,$SIGNAL_RETURN,;t t
|
||||
s,@HAVE_SO_PEERCRED@,$HAVE_SO_PEERCRED,;t t
|
||||
s,@HAVE_GETPEEREID@,$HAVE_GETPEEREID,;t t
|
||||
s,@HELP_DIR@,$HELP_DIR,;t t
|
||||
s,@RC_DIR@,$RC_DIR,;t t
|
||||
s,@DOCDIRS@,$DOCDIRS,;t t
|
||||
|
||||
+2
-5
@@ -67,7 +67,6 @@ AC_W3M_MENU
|
||||
AC_W3M_MOUSE
|
||||
AC_W3M_HISTORY
|
||||
AC_W3M_ALARM
|
||||
AC_W3M_REMOTE
|
||||
|
||||
AC_W3M_COOKIE
|
||||
AC_W3M_DIGEST_AUTH
|
||||
@@ -84,7 +83,7 @@ AC_W3M_MAILER
|
||||
AC_W3M_EXT_BROWSER
|
||||
|
||||
dnl Checks for ext libs
|
||||
for lib in bsd BSD 44bsd socket dld
|
||||
for lib in bsd BSD 44bsd socket nsl dld dl
|
||||
do
|
||||
AC_W3M_EXTLIBS($lib)
|
||||
done
|
||||
@@ -111,7 +110,7 @@ AC_DEFINE(AUXBIN_TARGETS, "$AUXBIN_TARGETS")
|
||||
|
||||
AC_SUBST(USE_BINMODE_STREAM)
|
||||
case "$host_os" in
|
||||
*cygwin*|*os2-emx*|*mingw*)
|
||||
*cygwin*|*os2-emx*)
|
||||
AC_DEFINE(USE_BINMODE_STREAM)
|
||||
;;
|
||||
esac
|
||||
@@ -153,8 +152,6 @@ AM_LANGINFO_CODESET
|
||||
AC_W3M_SYS_ERRLIST
|
||||
AC_W3M_SIGSETJMP
|
||||
AC_W3M_SIGNAL
|
||||
AC_W3M_SO_PEERCRED
|
||||
AC_W3M_GETPEEREID
|
||||
|
||||
AC_SUBST(HELP_DIR)
|
||||
HELP_DIR="$datadir/$PACKAGE"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/* $Id: etc.c,v 1.79 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: etc.c,v 1.80 2006/04/07 13:21:11 inu Exp $ */
|
||||
#include "fm.h"
|
||||
#ifndef __MINGW32_VERSION
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
#include "myctype.h"
|
||||
#include "html.h"
|
||||
#include "local.h"
|
||||
@@ -1312,13 +1310,9 @@ romanAlphabet(int n)
|
||||
static void
|
||||
reset_signals(void)
|
||||
{
|
||||
#ifdef SIGHUP
|
||||
mySignal(SIGHUP, SIG_DFL); /* terminate process */
|
||||
#endif
|
||||
mySignal(SIGINT, SIG_DFL); /* terminate process */
|
||||
#ifdef SIGQUIT
|
||||
mySignal(SIGQUIT, SIG_DFL); /* terminate process */
|
||||
#endif
|
||||
mySignal(SIGTERM, SIG_DFL); /* terminate process */
|
||||
mySignal(SIGILL, SIG_DFL); /* create core image */
|
||||
mySignal(SIGIOT, SIG_DFL); /* create core image */
|
||||
@@ -1361,10 +1355,8 @@ setup_child(int child, int i, int f)
|
||||
{
|
||||
reset_signals();
|
||||
mySignal(SIGINT, SIG_IGN);
|
||||
#ifndef __MINGW32_VERSION
|
||||
if (!child)
|
||||
SETPGRP();
|
||||
#endif /* __MINGW32_VERSION */
|
||||
close_tty();
|
||||
close_all_fds_except(i, f);
|
||||
QuietMessage = TRUE;
|
||||
@@ -1372,7 +1364,6 @@ setup_child(int child, int i, int f)
|
||||
TrapSignal = FALSE;
|
||||
}
|
||||
|
||||
#ifndef __MINGW32_VERSION
|
||||
pid_t
|
||||
open_pipe_rw(FILE ** fr, FILE ** fw)
|
||||
{
|
||||
@@ -1430,7 +1421,6 @@ open_pipe_rw(FILE ** fr, FILE ** fw)
|
||||
err0:
|
||||
return (pid_t) - 1;
|
||||
}
|
||||
#endif /* __MINGW32_VERSION */
|
||||
|
||||
void
|
||||
myExec(char *command)
|
||||
@@ -1443,7 +1433,6 @@ myExec(char *command)
|
||||
void
|
||||
mySystem(char *command, int background)
|
||||
{
|
||||
#ifndef __MINGW32_VERSION
|
||||
if (background) {
|
||||
#ifndef __EMX__
|
||||
flush_tty();
|
||||
@@ -1458,7 +1447,6 @@ mySystem(char *command, int background)
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif /* __MINGW32_VERSION */
|
||||
system(command);
|
||||
}
|
||||
|
||||
@@ -1528,13 +1516,6 @@ myEditor(char *cmd, char *file, int line)
|
||||
return tmp;
|
||||
}
|
||||
|
||||
#ifdef __MINGW32_VERSION
|
||||
char *
|
||||
expandName(char *name)
|
||||
{
|
||||
return getenv("HOME");
|
||||
}
|
||||
#else
|
||||
char *
|
||||
expandName(char *name)
|
||||
{
|
||||
@@ -1578,7 +1559,6 @@ expandName(char *name)
|
||||
rest:
|
||||
return name;
|
||||
}
|
||||
#endif
|
||||
|
||||
char *
|
||||
file_to_url(char *file)
|
||||
@@ -1918,11 +1898,7 @@ mymktime(char *timestr)
|
||||
#ifdef INET6
|
||||
#include <sys/socket.h>
|
||||
#endif /* INET6 */
|
||||
#ifndef __MINGW32_VERSION
|
||||
#include <netdb.h>
|
||||
#else
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
char *
|
||||
FQDN(char *host)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: file.c,v 1.239 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: file.c,v 1.240 2006/04/07 13:21:11 inu Exp $ */
|
||||
#include "fm.h"
|
||||
#include <sys/types.h>
|
||||
#include "myctype.h"
|
||||
@@ -50,7 +50,7 @@ static struct table_mode table_mode[MAX_TABLE];
|
||||
#ifdef USE_IMAGE
|
||||
static ParsedURL *cur_baseURL = NULL;
|
||||
#ifdef USE_M17N
|
||||
static wc_ces cur_document_charset;
|
||||
static char cur_document_charset;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -836,15 +836,13 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
|
||||
}
|
||||
if (pu && name->length > 0) {
|
||||
int err;
|
||||
if (show_cookie) {
|
||||
if (flag & COO_SECURE)
|
||||
disp_message_nsec("Received a secured cookie", FALSE, 1,
|
||||
if (flag & COO_SECURE)
|
||||
disp_message_nsec("Received a secured cookie", FALSE, 1,
|
||||
TRUE, FALSE);
|
||||
else
|
||||
disp_message_nsec(Sprintf("Received cookie: %s=%s",
|
||||
else
|
||||
disp_message_nsec(Sprintf("Received cookie: %s=%s",
|
||||
name->ptr, value->ptr)->ptr,
|
||||
FALSE, 1, TRUE, FALSE);
|
||||
}
|
||||
err =
|
||||
add_cookie(pu, name, value, expires, domain, path, flag,
|
||||
comment, version, port, commentURL);
|
||||
@@ -876,12 +874,10 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
|
||||
emsg =
|
||||
"This cookie was rejected to prevent security violation.";
|
||||
record_err_message(emsg);
|
||||
if (show_cookie)
|
||||
disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE);
|
||||
disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE);
|
||||
}
|
||||
else
|
||||
if (show_cookie)
|
||||
disp_message_nsec(Sprintf
|
||||
disp_message_nsec(Sprintf
|
||||
("Accepting invalid cookie: %s=%s",
|
||||
name->ptr, value->ptr)->ptr, FALSE,
|
||||
1, TRUE, FALSE);
|
||||
@@ -1603,17 +1599,9 @@ getAuthCookie(struct http_auth *hauth, char *auth_header,
|
||||
getpassphrase(proxy ? "Proxy Password: " :
|
||||
"Password: "));
|
||||
#else
|
||||
#ifndef __MINGW32_VERSION
|
||||
*pwd = Strnew_charp((char *)
|
||||
getpass(proxy ? "Proxy Password: " :
|
||||
"Password: "));
|
||||
#else
|
||||
term_raw();
|
||||
*pwd = Strnew_charp((char *)
|
||||
inputLine(proxy ? "Proxy Password: " :
|
||||
"Password: ", NULL, IN_PASSWORD));
|
||||
term_cbreak();
|
||||
#endif /* __MINGW32_VERSION */
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -5293,17 +5281,6 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
|
||||
buf->hmarklist =
|
||||
putHmarker(buf->hmarklist, currentLn(buf),
|
||||
pos, hseq - 1);
|
||||
else if (hseq < 0) {
|
||||
int h = -hseq - 1;
|
||||
if (buf->hmarklist &&
|
||||
h < buf->hmarklist->nmark &&
|
||||
buf->hmarklist->marks[h].invalid) {
|
||||
buf->hmarklist->marks[h].pos = pos;
|
||||
buf->hmarklist->marks[h].line = currentLn(buf);
|
||||
buf->hmarklist->marks[h].invalid = 0;
|
||||
hseq = -hseq;
|
||||
}
|
||||
}
|
||||
if (id && idFrame)
|
||||
idFrame->body->nameList =
|
||||
putAnchor(idFrame->body->nameList, id, NULL,
|
||||
@@ -5323,12 +5300,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
|
||||
a_href->end.line = currentLn(buf);
|
||||
a_href->end.pos = pos;
|
||||
if (a_href->start.line == a_href->end.line &&
|
||||
a_href->start.pos == a_href->end.pos) {
|
||||
if (buf->hmarklist &&
|
||||
a_href->hseq < buf->hmarklist->nmark)
|
||||
buf->hmarklist->marks[a_href->hseq].invalid = 1;
|
||||
a_href->start.pos == a_href->end.pos)
|
||||
a_href->hseq = -1;
|
||||
}
|
||||
a_href = NULL;
|
||||
}
|
||||
break;
|
||||
@@ -7697,7 +7670,6 @@ _MoveFile(char *path1, char *path2)
|
||||
int
|
||||
_doFileCopy(char *tmpf, char *defstr, int download)
|
||||
{
|
||||
#ifndef __MINGW32_VERSION
|
||||
Str msg;
|
||||
Str filen;
|
||||
char *p, *q = NULL;
|
||||
@@ -7804,7 +7776,6 @@ _doFileCopy(char *tmpf, char *defstr, int download)
|
||||
if (PreserveTimestamp && !is_pipe && !stat(tmpf, &st))
|
||||
setModtime(p, st.st_mtime);
|
||||
}
|
||||
#endif /* __MINGW32_VERSION */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -7819,7 +7790,6 @@ doFileMove(char *tmpf, char *defstr)
|
||||
int
|
||||
doFileSave(URLFile uf, char *defstr)
|
||||
{
|
||||
#ifndef __MINGW32_VERSION
|
||||
Str msg;
|
||||
Str filen;
|
||||
char *p, *q;
|
||||
@@ -7905,7 +7875,6 @@ doFileSave(URLFile uf, char *defstr)
|
||||
if (PreserveTimestamp && uf.modtime != -1)
|
||||
setModtime(p, uf.modtime);
|
||||
}
|
||||
#endif /* __MINGW32_VERSION */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -7976,7 +7945,6 @@ inputAnswer(char *prompt)
|
||||
static void
|
||||
uncompress_stream(URLFile *uf, char **src)
|
||||
{
|
||||
#ifndef __MINGW32_VERSION
|
||||
pid_t pid1;
|
||||
FILE *f1;
|
||||
char *expand_cmd = GUNZIP_CMDNAME;
|
||||
@@ -8060,7 +8028,6 @@ uncompress_stream(URLFile *uf, char **src)
|
||||
}
|
||||
UFhalfclose(uf);
|
||||
uf->stream = newFileStream(f1, (void (*)())fclose);
|
||||
#endif /* __MINGW32_VERSION */
|
||||
}
|
||||
|
||||
static FILE *
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: fm.h,v 1.128 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: fm.h,v 1.129 2006/04/07 13:21:11 inu Exp $ */
|
||||
/*
|
||||
* w3m: WWW wo Miru utility
|
||||
*
|
||||
@@ -336,7 +336,6 @@ typedef struct _Line {
|
||||
typedef struct {
|
||||
int line;
|
||||
int pos;
|
||||
int invalid;
|
||||
} BufferPoint;
|
||||
|
||||
#ifdef USE_IMAGE
|
||||
@@ -868,6 +867,7 @@ global int TabCols init(10);
|
||||
global DownloadList *FirstDL init(NULL);
|
||||
global DownloadList *LastDL init(NULL);
|
||||
global int CurrentKey;
|
||||
global char *CurrentKeyData;
|
||||
global char *CurrentCmdData;
|
||||
|
||||
extern char *w3m_version;
|
||||
@@ -1076,7 +1076,6 @@ global MouseAction mouse_action;
|
||||
#ifdef USE_COOKIE
|
||||
global int default_use_cookie init(TRUE);
|
||||
global int use_cookie init(FALSE);
|
||||
global int show_cookie init(TRUE);
|
||||
global int accept_cookie init(FALSE);
|
||||
#define ACCEPT_BAD_COOKIE_DISCARD 0
|
||||
#define ACCEPT_BAD_COOKIE_ACCEPT 1
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/* $Id: ftp.c,v 1.36 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: ftp.c,v 1.37 2006/04/07 13:21:11 inu Exp $ */
|
||||
#include <stdio.h>
|
||||
#ifndef __MINGW32_VERSION
|
||||
#include <pwd.h>
|
||||
#endif /* __MINGW32_VERSION */
|
||||
#include <Str.h>
|
||||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
@@ -16,14 +14,10 @@
|
||||
#include <malloc.h>
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef __MINGW32_VERSION
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#else
|
||||
#include <winsock.h>
|
||||
#endif /* __MINGW32_VERSION */
|
||||
|
||||
typedef struct _FTP {
|
||||
char *host;
|
||||
@@ -377,14 +371,7 @@ openFTPStream(ParsedURL *pu, URLFile *uf)
|
||||
term_cbreak();
|
||||
}
|
||||
else {
|
||||
#ifndef __MINGW32_VERSION
|
||||
pwd = Strnew_charp((char *)getpass("Password: "));
|
||||
#else
|
||||
term_raw();
|
||||
pwd = Strnew_charp(inputLine("Password: ", NULL, IN_PASSWORD));
|
||||
pwd = Str_conv_to_system(pwd);
|
||||
term_cbreak();
|
||||
#endif /* __MINGW32_VERSION */
|
||||
}
|
||||
add_auth_cookie_flag = TRUE;
|
||||
}
|
||||
@@ -393,12 +380,8 @@ openFTPStream(ParsedURL *pu, URLFile *uf)
|
||||
else if (ftppasswd != NULL && *ftppasswd != '\0')
|
||||
pass = ftppasswd;
|
||||
else {
|
||||
#ifndef __MINGW32_VERSION
|
||||
struct passwd *mypw = getpwuid(getuid());
|
||||
tmp = Strnew_charp(mypw ? mypw->pw_name : "anonymous");
|
||||
#else
|
||||
tmp = Strnew_charp("anonymous");
|
||||
#endif __MINGW32_VERSION
|
||||
Strcat_char(tmp, '@');
|
||||
pass = tmp->ptr;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/* $Id: indep.c,v 1.36 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: indep.c,v 1.37 2006/04/07 13:21:11 inu Exp $ */
|
||||
#include "fm.h"
|
||||
#include <stdio.h>
|
||||
#ifndef __MINGW32_VERSION
|
||||
#include <pwd.h>
|
||||
#endif /* __MINGW32_VERSION */
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
@@ -227,7 +225,6 @@ expandPath(char *name)
|
||||
p = name;
|
||||
if (*p == '~') {
|
||||
p++;
|
||||
#ifndef __MINGW32_VERSION
|
||||
if (IS_ALPHA(*p)) {
|
||||
char *q = strchr(p, '/');
|
||||
if (q) { /* ~user/dir... */
|
||||
@@ -241,9 +238,8 @@ expandPath(char *name)
|
||||
if (!passent)
|
||||
goto rest;
|
||||
extpath = Strnew_charp(passent->pw_dir);
|
||||
} else
|
||||
#endif /* __MINGW32_VERSION */
|
||||
if (*p == '/' || *p == '\0') { /* ~/dir... or ~ */
|
||||
}
|
||||
else if (*p == '/' || *p == '\0') { /* ~/dir... or ~ */
|
||||
extpath = Strnew_charp(getenv("HOME"));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: istream.c,v 1.24 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: istream.c,v 1.25 2006/04/07 13:21:11 inu Exp $ */
|
||||
#include "fm.h"
|
||||
#include "myctype.h"
|
||||
#include "istream.h"
|
||||
@@ -6,9 +6,6 @@
|
||||
#ifdef USE_SSL
|
||||
#include <openssl/x509v3.h>
|
||||
#endif
|
||||
#ifdef __MINGW32_VERSION
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
|
||||
#define uchar unsigned char
|
||||
|
||||
@@ -620,21 +617,13 @@ ssl_get_certificate(SSL * ssl, char *hostname)
|
||||
static void
|
||||
basic_close(int *handle)
|
||||
{
|
||||
#ifdef __MINGW32_VERSION
|
||||
closesocket(*(int *)handle);
|
||||
#else
|
||||
close(*(int *)handle);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
basic_read(int *handle, char *buf, int len)
|
||||
{
|
||||
#ifdef __MINGW32_VERSION
|
||||
return recv(*(int *)handle, buf, len, 0);
|
||||
#else
|
||||
return read(*(int *)handle, buf, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: local.c,v 1.32 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: local.c,v 1.33 2006/04/07 13:21:11 inu Exp $ */
|
||||
#include "fm.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@@ -16,10 +16,6 @@
|
||||
#include "local.h"
|
||||
#include "hash.h"
|
||||
|
||||
#ifdef __MINGW32_VERSION
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
|
||||
#define CGIFN_NORMAL 0
|
||||
#define CGIFN_LIBDIR 1
|
||||
#define CGIFN_CGIBIN 2
|
||||
@@ -197,10 +193,8 @@ check_local_cgi(char *file, int status)
|
||||
return -1;
|
||||
if (S_ISDIR(st.st_mode))
|
||||
return -1;
|
||||
#ifndef __MINGW32_VERSION
|
||||
if ((st.st_uid == geteuid() && (st.st_mode & S_IXUSR)) || (st.st_gid == getegid() && (st.st_mode & S_IXGRP)) || (st.st_mode & S_IXOTH)) /* executable */
|
||||
return 0;
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -359,9 +353,6 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
|
||||
pid_t pid;
|
||||
char *file = uri, *name = uri, *path_info = NULL, *tmpf = NULL;
|
||||
|
||||
#ifdef __MINGW32_VERSION
|
||||
return NULL;
|
||||
#else
|
||||
status = cgi_filename(uri, &file, &name, &path_info);
|
||||
if (check_local_cgi(file, status) < 0)
|
||||
return NULL;
|
||||
@@ -421,5 +412,4 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
|
||||
file, mybasename(file), strerror(errno));
|
||||
exit(1);
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: main.c,v 1.248 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: main.c,v 1.249 2006/04/07 13:21:11 inu Exp $ */
|
||||
#define MAINPROGRAM
|
||||
#include "fm.h"
|
||||
#include <signal.h>
|
||||
@@ -14,13 +14,6 @@
|
||||
#include "terms.h"
|
||||
#include "myctype.h"
|
||||
#include "regex.h"
|
||||
|
||||
#ifdef USE_REMOTE
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_MOUSE
|
||||
#ifdef USE_GPM
|
||||
#include <gpm.h>
|
||||
@@ -31,12 +24,6 @@ extern int do_getch();
|
||||
#endif /* defined(USE_GPM) || defined(USE_SYSMOUSE) */
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32_VERSION
|
||||
#include <winsock.h>
|
||||
|
||||
WSADATA WSAData;
|
||||
#endif
|
||||
|
||||
#define DSTR_LEN 256
|
||||
|
||||
Hist *LoadHist;
|
||||
@@ -78,11 +65,7 @@ static char *MarkString = NULL;
|
||||
static char *SearchString = NULL;
|
||||
int (*searchRoutine) (Buffer *, char *);
|
||||
|
||||
#ifndef __MINGW32_VERSION
|
||||
JMP_BUF IntReturn;
|
||||
#else
|
||||
_JBTYPE IntReturn[_JBLEN];
|
||||
#endif /* __MINGW32_VERSION */
|
||||
|
||||
static void delBuffer(Buffer *buf);
|
||||
static void cmd_loadfile(char *path);
|
||||
@@ -121,19 +104,6 @@ static int searchKeyNum(void);
|
||||
#define help() fusage(stdout, 0)
|
||||
#define usage() fusage(stderr, 1)
|
||||
|
||||
#ifdef USE_REMOTE
|
||||
static int open_remote(int id);
|
||||
static void execute_remote(int sock, char *arg);
|
||||
static Str find_sock(int pid);
|
||||
static int init_serv(void);
|
||||
static int init_remote(char *prefix);
|
||||
static void parse_sock_data(void);
|
||||
static Str SockName;
|
||||
static int SockFd = -1, UseRemote = FALSE, ExecuteRemote = FALSE, RemoteId = -1;
|
||||
struct sockaddr_un SockAddr;
|
||||
socklen_t SockLength;
|
||||
#endif
|
||||
|
||||
static void
|
||||
fversion(FILE * f)
|
||||
{
|
||||
@@ -164,9 +134,6 @@ fversion(FILE * f)
|
||||
",sysmouse"
|
||||
#endif
|
||||
#endif
|
||||
#ifdef USE_REMOTE
|
||||
",remote"
|
||||
#endif
|
||||
#ifdef USE_MENU
|
||||
",menu"
|
||||
#endif
|
||||
@@ -262,11 +229,6 @@ fusage(FILE * f, int err)
|
||||
#ifdef USE_MOUSE
|
||||
fprintf(f, " -no-mouse don't use mouse\n");
|
||||
#endif /* USE_MOUSE */
|
||||
#ifdef USE_REMOTE
|
||||
fprintf(f, " -enable_remote accept remote operation\n");
|
||||
fprintf(f, " -remote command execute command in an already running w3m process\n");
|
||||
fprintf(f, " -remote_id pid select a w3m to control with -remote option\n");
|
||||
#endif /* USE_MOUSE */
|
||||
#ifdef USE_COOKIE
|
||||
fprintf(f,
|
||||
" -cookie use cookie (-no-cookie: don't use cookie)\n");
|
||||
@@ -765,33 +727,6 @@ main(int argc, char **argv, char **envp)
|
||||
else if (!strcmp("-dummy", argv[i])) {
|
||||
/* do nothing */
|
||||
}
|
||||
#ifdef USE_REMOTE
|
||||
else if (!strcmp("-enable_remote", argv[i])) {
|
||||
UseRemote = TRUE;
|
||||
}
|
||||
else if (!strcmp("-remote_id", argv[i])) {
|
||||
if (++i >= argc)
|
||||
usage();
|
||||
RemoteId = atoi(argv[i]);
|
||||
}
|
||||
else if (!strcmp("-remote", argv[i])) {
|
||||
ExecuteRemote = TRUE;
|
||||
|
||||
SockFd = open_remote(RemoteId);
|
||||
if (SockFd < 0) {
|
||||
fprintf(stderr, "Can't find w3m process.\n");
|
||||
exit(1);
|
||||
}
|
||||
while (++i < argc) {
|
||||
if ((*argv[i] == '+') || (*argv[i] == '-')) {
|
||||
i--;
|
||||
break;
|
||||
}
|
||||
execute_remote(SockFd, argv[i]);
|
||||
}
|
||||
close(SockFd);
|
||||
}
|
||||
#endif
|
||||
else if (!strcmp("-debug", argv[i]))
|
||||
w3m_debug = TRUE;
|
||||
else {
|
||||
@@ -806,34 +741,13 @@ main(int argc, char **argv, char **envp)
|
||||
}
|
||||
i++;
|
||||
}
|
||||
#ifdef USE_REMOTE
|
||||
if (ExecuteRemote) {
|
||||
exit(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __WATT32__
|
||||
if (w3m_debug)
|
||||
dbug_init();
|
||||
sock_init();
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32_VERSION
|
||||
{
|
||||
int err;
|
||||
WORD wVerReq;
|
||||
|
||||
wVerReq = MAKEWORD(1, 1);
|
||||
|
||||
err = WSAStartup(wVerReq, &WSAData);
|
||||
if (err != 0)
|
||||
{
|
||||
fprintf(stderr, "Can't find winsock\n");
|
||||
return 1;
|
||||
}
|
||||
_fmode = _O_BINARY;
|
||||
}
|
||||
#endif
|
||||
|
||||
FirstTab = NULL;
|
||||
LastTab = NULL;
|
||||
nTab = 0;
|
||||
@@ -1114,13 +1028,6 @@ main(int argc, char **argv, char **envp)
|
||||
if (line_str) {
|
||||
_goLine(line_str);
|
||||
}
|
||||
|
||||
#ifdef USE_REMOTE
|
||||
if (UseRemote) {
|
||||
init_serv();
|
||||
}
|
||||
#endif
|
||||
|
||||
for (;;) {
|
||||
if (add_download_list) {
|
||||
add_download_list = FALSE;
|
||||
@@ -1137,6 +1044,7 @@ main(int argc, char **argv, char **envp)
|
||||
/* event processing */
|
||||
if (CurrentEvent) {
|
||||
CurrentKey = -1;
|
||||
CurrentKeyData = NULL;
|
||||
CurrentCmdData = (char *)CurrentEvent->data;
|
||||
w3mFuncList[CurrentEvent->cmd].func();
|
||||
CurrentCmdData = NULL;
|
||||
@@ -1151,6 +1059,7 @@ main(int argc, char **argv, char **envp)
|
||||
if (CurrentAlarm->sec == 0) { /* refresh (0sec) */
|
||||
Currentbuf->event = NULL;
|
||||
CurrentKey = -1;
|
||||
CurrentKeyData = NULL;
|
||||
CurrentCmdData = (char *)CurrentAlarm->data;
|
||||
w3mFuncList[CurrentAlarm->cmd].func();
|
||||
CurrentCmdData = NULL;
|
||||
@@ -1189,20 +1098,7 @@ main(int argc, char **argv, char **envp)
|
||||
} while (sleep_till_anykey(1, 0) <= 0);
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_REMOTE
|
||||
if (UseRemote) {
|
||||
int n;
|
||||
c = getch_select(SockFd, &n);
|
||||
if (n == 1) {
|
||||
parse_sock_data();
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
c = getch();
|
||||
}
|
||||
#else
|
||||
c = getch();
|
||||
#endif
|
||||
#ifdef SIGWINCH
|
||||
mySignal(SIGWINCH, resize_hook);
|
||||
#endif
|
||||
@@ -1230,240 +1126,10 @@ main(int argc, char **argv, char **envp)
|
||||
}
|
||||
prev_key = CurrentKey;
|
||||
CurrentKey = -1;
|
||||
CurrentKeyData = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_REMOTE
|
||||
#ifndef HAVE_GETPEEREID
|
||||
#ifdef HAVE_SO_PEERCRED
|
||||
int
|
||||
getpeereid(int s, uid_t *euid, gid_t *egid)
|
||||
{
|
||||
struct ucred cr;
|
||||
int cl = sizeof(cr), r;
|
||||
|
||||
r = getsockopt(s, SOL_SOCKET, SO_PEERCRED, &cr, &cl);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
*euid = cr.uid;
|
||||
*egid = cr.gid;
|
||||
return 0;
|
||||
}
|
||||
#endif /* HAVE_SO_PEERCRED */
|
||||
#endif /* ! HAVE_GETPEEREID */
|
||||
|
||||
static int
|
||||
open_remote(int id)
|
||||
{
|
||||
#if defined(HAVE_SO_PEERCRED) || defined(HAVE_GETPEEREID)
|
||||
uid_t euid;
|
||||
gid_t egid;
|
||||
#endif
|
||||
Str sock_name = find_sock(id);
|
||||
|
||||
if (! sock_name)
|
||||
return -1;
|
||||
|
||||
if (sizeof(SockAddr.sun_path) <= sock_name->length)
|
||||
return -1;
|
||||
|
||||
if (init_remote("w3mclis"))
|
||||
return -1;
|
||||
|
||||
SockAddr.sun_family = AF_UNIX;
|
||||
strcpy(SockAddr.sun_path, sock_name->ptr);
|
||||
SockLength = sizeof(SockAddr.sun_family) + strlen(SockAddr.sun_path);
|
||||
|
||||
if (connect(SockFd, (struct sockaddr *) &SockAddr, SockLength)) {
|
||||
close(SockFd);
|
||||
unlink(SockName->ptr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if defined(HAVE_SO_PEERCRED) || defined(HAVE_GETPEEREID)
|
||||
if (getpeereid(SockFd, &euid, &egid) != 0 || euid != getuid()) {
|
||||
close(SockFd);
|
||||
unlink(SockName->ptr);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return SockFd;
|
||||
}
|
||||
|
||||
static void
|
||||
execute_remote(int sock, char *arg)
|
||||
{
|
||||
write(sock, arg, strlen(arg));
|
||||
write(sock, "\n", 1);
|
||||
}
|
||||
|
||||
static Str
|
||||
find_sock(int pid)
|
||||
{
|
||||
DIR *dot_w3m;
|
||||
Str sock_name;
|
||||
struct dirent *file = NULL;
|
||||
struct stat sbuf;
|
||||
|
||||
if (pid > 0) {
|
||||
sock_name = Sprintf("w3msock%d", pid);
|
||||
} else {
|
||||
sock_name = Strnew_charp("w3msock");
|
||||
}
|
||||
|
||||
dot_w3m = opendir(rc_dir);
|
||||
if (! dot_w3m)
|
||||
return NULL;
|
||||
|
||||
while ((file = readdir(dot_w3m))) {
|
||||
if ((pid > 0 && (Strcmp_charp(sock_name, file->d_name) == 0)) ||
|
||||
(pid <= 0 && Strncmp_charp(sock_name, file->d_name, sock_name->length) == 0)) {
|
||||
sock_name = Sprintf("%s/%s", rc_dir, file->d_name);
|
||||
if ((stat(sock_name->ptr, &sbuf) == 0) &&
|
||||
(sbuf.st_mode & S_IFSOCK) &&
|
||||
!(sbuf.st_mode & (S_IRWXO | S_IRWXG)) &&
|
||||
(sbuf.st_uid == getuid()))
|
||||
goto SockFound;
|
||||
}
|
||||
}
|
||||
closedir(dot_w3m);
|
||||
return NULL;
|
||||
|
||||
SockFound:
|
||||
closedir(dot_w3m);
|
||||
return sock_name;
|
||||
}
|
||||
|
||||
static int
|
||||
init_serv(void)
|
||||
{
|
||||
if (init_remote("w3msock")) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (listen(SockFd, 5)) {
|
||||
unlink(SockName->ptr);
|
||||
close(SockFd);
|
||||
SockFd = -1;
|
||||
UseRemote = FALSE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
fcntl(SockFd, F_SETFL, O_NONBLOCK);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
init_remote(char *prefix)
|
||||
{
|
||||
SockName = Sprintf("%s/%s%d", rc_dir, prefix, CurrentPid);
|
||||
if (sizeof(SockAddr.sun_path) <= SockName->length)
|
||||
goto SockErr;
|
||||
|
||||
SockAddr.sun_family = AF_UNIX;
|
||||
strcpy(SockAddr.sun_path, SockName->ptr);
|
||||
SockLength = sizeof(SockAddr.sun_family) + strlen(SockAddr.sun_path);
|
||||
|
||||
if ((SockFd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
|
||||
goto SockErr;
|
||||
|
||||
unlink(SockName->ptr);
|
||||
if (bind(SockFd, (struct sockaddr *) &SockAddr, SockLength))
|
||||
goto SockErr;
|
||||
|
||||
chmod(SockName->ptr, S_IRUSR | S_IWUSR);
|
||||
return 0;
|
||||
|
||||
SockErr:
|
||||
unlink(SockName->ptr);
|
||||
if (SockFd >= 0) {
|
||||
close(SockFd);
|
||||
}
|
||||
SockFd = -1;
|
||||
UseRemote = FALSE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
parse_sock_data(void)
|
||||
{
|
||||
Str data = NULL;
|
||||
char buf[64];
|
||||
char *p, *q, *s;
|
||||
int l, f, conn;
|
||||
struct sockaddr_un sock_addr = SockAddr;
|
||||
socklen_t sock_length = SockLength;
|
||||
#if defined(HAVE_SO_PEERCRED) || defined(HAVE_GETPEEREID)
|
||||
uid_t euid;
|
||||
gid_t egid;
|
||||
#else
|
||||
struct stat sbuf;
|
||||
time_t staletime;
|
||||
#endif
|
||||
|
||||
if (!UseRemote || SockFd < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data)
|
||||
data = Strnew();
|
||||
|
||||
conn = accept(SockFd, (struct sockaddr *) &sock_addr, &sock_length);
|
||||
|
||||
if (conn < 0)
|
||||
return;
|
||||
|
||||
|
||||
sock_length -= sizeof(sock_addr.sun_family);
|
||||
sock_addr.sun_path[sock_length] = '\0';
|
||||
#if defined(HAVE_SO_PEERCRED) || defined(HAVE_GETPEEREID)
|
||||
if (getpeereid(conn, &euid, &egid) != 0 || euid != getuid()) {
|
||||
#else
|
||||
#define STALE_LIMIT 60
|
||||
staletime = time(NULL) - STALE_LIMIT;
|
||||
if ((stat(sock_addr.sun_path, &sbuf) < 0) ||
|
||||
!(sbuf.st_mode & S_IFSOCK) ||
|
||||
(sbuf.st_mode & (S_IRWXO | S_IRWXG)) ||
|
||||
(sbuf.st_uid != getuid()) ||
|
||||
(sbuf.st_atime < staletime) ||
|
||||
(sbuf.st_ctime < staletime) ||
|
||||
(sbuf.st_mtime < staletime)) {
|
||||
#endif
|
||||
close(conn);
|
||||
return;
|
||||
}
|
||||
unlink(sock_addr.sun_path);
|
||||
while ((l = read(conn, buf, sizeof(buf))) > 0) {
|
||||
Strcat_charp_n(data, buf, l);
|
||||
}
|
||||
close(conn);
|
||||
|
||||
p = data->ptr;
|
||||
|
||||
while ((q = strchr(p, '\n'))) {
|
||||
Str funcname = Strnew();
|
||||
Str cmd = Strnew_charp_n(p, q - p);
|
||||
|
||||
s = cmd->ptr;
|
||||
SKIP_BLANKS(s);
|
||||
while (*s && !IS_SPACE(*s))
|
||||
Strcat_char(funcname, *(s++));
|
||||
|
||||
SKIP_BLANKS(s);
|
||||
f = getFuncList(funcname->ptr);
|
||||
if (f >= 0) {
|
||||
Str tmp = Strnew_charp(s);
|
||||
Strchop(tmp);
|
||||
pushEvent(f, tmp->ptr);
|
||||
}
|
||||
p = q + 1;
|
||||
}
|
||||
}
|
||||
#endif /* USE_REMOTE */
|
||||
|
||||
static void
|
||||
keyPressEventProc(int c)
|
||||
{
|
||||
@@ -2242,6 +1908,7 @@ DEFUN(setEnv, SETENV, "Set environment variable")
|
||||
char *env;
|
||||
char *var, *value;
|
||||
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
env = searchKeyData();
|
||||
if (env == NULL || *env == '\0' || strchr(env, '=') == NULL) {
|
||||
if (env != NULL && *env != '\0')
|
||||
@@ -2266,6 +1933,7 @@ DEFUN(pipeBuf, PIPE_BUF, "Send rendered document to pipe")
|
||||
char *cmd, *tmpf;
|
||||
FILE *f;
|
||||
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
cmd = searchKeyData();
|
||||
if (cmd == NULL || *cmd == '\0') {
|
||||
/* FIXME: gettextize? */
|
||||
@@ -2310,6 +1978,7 @@ DEFUN(pipesh, PIPE_SHELL, "Execute shell command and browse")
|
||||
Buffer *buf;
|
||||
char *cmd;
|
||||
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
cmd = searchKeyData();
|
||||
if (cmd == NULL || *cmd == '\0') {
|
||||
cmd = inputLineHist("(read shell[pipe])!", "", IN_COMMAND, ShellHist);
|
||||
@@ -2341,6 +2010,7 @@ DEFUN(readsh, READ_SHELL, "Execute shell command and load")
|
||||
MySignalHandler(*prevtrap) ();
|
||||
char *cmd;
|
||||
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
cmd = searchKeyData();
|
||||
if (cmd == NULL || *cmd == '\0') {
|
||||
cmd = inputLineHist("(read shell)!", "", IN_COMMAND, ShellHist);
|
||||
@@ -2375,6 +2045,7 @@ DEFUN(execsh, EXEC_SHELL SHELL, "Execute shell command")
|
||||
{
|
||||
char *cmd;
|
||||
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
cmd = searchKeyData();
|
||||
if (cmd == NULL || *cmd == '\0') {
|
||||
cmd = inputLineHist("(exec shell)!", "", IN_COMMAND, ShellHist);
|
||||
@@ -4478,6 +4149,7 @@ DEFUN(setOpt, SET_OPTION, "Set option")
|
||||
{
|
||||
char *opt;
|
||||
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
opt = searchKeyData();
|
||||
if (opt == NULL || *opt == '\0' || strchr(opt, '=') == NULL) {
|
||||
if (opt != NULL && *opt != '\0') {
|
||||
@@ -4663,6 +4335,7 @@ DEFUN(ldHist, HISTORY, "View history of URL")
|
||||
/* download HREF link */
|
||||
DEFUN(svA, SAVE_LINK, "Save link to file")
|
||||
{
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
do_download = TRUE;
|
||||
followA();
|
||||
do_download = FALSE;
|
||||
@@ -4671,6 +4344,7 @@ DEFUN(svA, SAVE_LINK, "Save link to file")
|
||||
/* download IMG link */
|
||||
DEFUN(svI, SAVE_IMAGE, "Save image to file")
|
||||
{
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
do_download = TRUE;
|
||||
followI();
|
||||
do_download = FALSE;
|
||||
@@ -4683,6 +4357,7 @@ DEFUN(svBuf, PRINT SAVE_SCREEN, "Save rendered document to file")
|
||||
FILE *f;
|
||||
int is_pipe;
|
||||
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
file = searchKeyData();
|
||||
if (file == NULL || *file == '\0') {
|
||||
/* FIXME: gettextize? */
|
||||
@@ -4731,6 +4406,7 @@ DEFUN(svSrc, DOWNLOAD SAVE, "Save document source to file")
|
||||
|
||||
if (Currentbuf->sourcefile == NULL)
|
||||
return;
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
PermitSaveToPipe = TRUE;
|
||||
if (Currentbuf->real_scheme == SCM_LOCAL)
|
||||
file = conv_from_system(guess_save_name(NULL,
|
||||
@@ -5267,6 +4943,7 @@ invoke_browser(char *url)
|
||||
char *browser = NULL;
|
||||
int bg = 0, len;
|
||||
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
browser = searchKeyData();
|
||||
if (browser == NULL || *browser == '\0') {
|
||||
switch (prec_num) {
|
||||
@@ -5507,6 +5184,7 @@ do_mouse_action(int btn, int x, int y)
|
||||
mouse_action.cursorX = x;
|
||||
mouse_action.cursorY = y;
|
||||
CurrentKey = -1;
|
||||
CurrentKeyData = NULL;
|
||||
CurrentCmdData = map->data;
|
||||
(*map->func) ();
|
||||
CurrentCmdData = NULL;
|
||||
@@ -5965,10 +5643,13 @@ searchKeyData(void)
|
||||
{
|
||||
char *data = NULL;
|
||||
|
||||
if (CurrentCmdData != NULL && *CurrentCmdData != '\0')
|
||||
if (CurrentKeyData != NULL && *CurrentKeyData != '\0')
|
||||
data = CurrentKeyData;
|
||||
else if (CurrentCmdData != NULL && *CurrentCmdData != '\0')
|
||||
data = CurrentCmdData;
|
||||
else if (CurrentKey >= 0)
|
||||
data = getKeyData(CurrentKey);
|
||||
CurrentKeyData = NULL;
|
||||
CurrentCmdData = NULL;
|
||||
if (data == NULL || *data == '\0')
|
||||
return NULL;
|
||||
@@ -6032,14 +5713,6 @@ w3m_exit(int i)
|
||||
disconnectFTP();
|
||||
#ifdef USE_NNTP
|
||||
disconnectNews();
|
||||
#endif
|
||||
#ifdef USE_REMOTE
|
||||
if (UseRemote) {
|
||||
unlink(SockName->ptr);
|
||||
}
|
||||
#endif
|
||||
#ifdef __MINGW32_VERSION
|
||||
WSACleanup();
|
||||
#endif
|
||||
exit(i);
|
||||
}
|
||||
@@ -6049,6 +5722,7 @@ DEFUN(execCmd, COMMAND, "Execute w3m command(s)")
|
||||
char *data, *p;
|
||||
int cmd;
|
||||
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
data = searchKeyData();
|
||||
if (data == NULL || *data == '\0') {
|
||||
data = inputStrHist("command [; ...]: ", "", TextHist);
|
||||
@@ -6070,6 +5744,7 @@ DEFUN(execCmd, COMMAND, "Execute w3m command(s)")
|
||||
break;
|
||||
p = getQWord(&data);
|
||||
CurrentKey = -1;
|
||||
CurrentKeyData = NULL;
|
||||
CurrentCmdData = *p ? p : NULL;
|
||||
#ifdef USE_MOUSE
|
||||
if (use_mouse)
|
||||
@@ -6093,6 +5768,7 @@ SigAlarm(SIGNAL_ARG)
|
||||
|
||||
if (CurrentAlarm->sec > 0) {
|
||||
CurrentKey = -1;
|
||||
CurrentKeyData = NULL;
|
||||
CurrentCmdData = data = (char *)CurrentAlarm->data;
|
||||
#ifdef USE_MOUSE
|
||||
if (use_mouse)
|
||||
@@ -6130,6 +5806,7 @@ DEFUN(setAlarm, ALARM, "Set alarm")
|
||||
char *data;
|
||||
int sec = 0, cmd = -1;
|
||||
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
data = searchKeyData();
|
||||
if (data == NULL || *data == '\0') {
|
||||
data = inputStrHist("(Alarm)sec command: ", "", TextHist);
|
||||
@@ -6242,6 +5919,7 @@ DEFUN(defKey, DEFINE_KEY,
|
||||
{
|
||||
char *data;
|
||||
|
||||
CurrentKeyData = NULL; /* not allowed in w3m-control: */
|
||||
data = searchKeyData();
|
||||
if (data == NULL || *data == '\0') {
|
||||
data = inputStrHist("Key definition: ", "", TextHist);
|
||||
@@ -6760,9 +6438,7 @@ download_action(struct parsed_tagarg *arg)
|
||||
for (; arg; arg = arg->next) {
|
||||
if (!strncmp(arg->arg, "stop", 4)) {
|
||||
pid = (pid_t) atoi(&arg->arg[4]);
|
||||
#ifndef __MINGW32_VERSION
|
||||
kill(pid, SIGKILL);
|
||||
#endif
|
||||
}
|
||||
else if (!strncmp(arg->arg, "ok", 2))
|
||||
pid = (pid_t) atoi(&arg->arg[2]);
|
||||
@@ -6796,9 +6472,7 @@ stopDownload(void)
|
||||
for (d = FirstDL; d != NULL; d = d->next) {
|
||||
if (d->ok)
|
||||
continue;
|
||||
#ifndef __MINGW32_VERSION
|
||||
kill(d->pid, SIGKILL);
|
||||
#endif
|
||||
unlink(d->lock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: menu.c,v 1.44 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: menu.c,v 1.45 2006/04/07 13:21:12 inu Exp $ */
|
||||
/*
|
||||
* w3m menu.c
|
||||
*/
|
||||
@@ -590,6 +590,7 @@ action_menu(Menu *menu)
|
||||
*item.variable = item.value;
|
||||
if (item.type & MENU_FUNC) {
|
||||
CurrentKey = -1;
|
||||
CurrentKeyData = NULL;
|
||||
CurrentCmdData = item.data;
|
||||
(*item.func) ();
|
||||
CurrentCmdData = NULL;
|
||||
@@ -1737,23 +1738,6 @@ initMenu(void)
|
||||
}
|
||||
}
|
||||
|
||||
DEFUN(interpretAsMenu, INTERPRET_AS_MENU, "Interpret current document as menu-definition")
|
||||
{
|
||||
FILE *mf;
|
||||
MenuList *list;
|
||||
|
||||
if ((mf = fopen(Currentbuf->sourcefile, "r")) != NULL) {
|
||||
interpret_menu(mf);
|
||||
fclose(mf);
|
||||
|
||||
for (list = w3mMenuList; list->id != NULL; list++) {
|
||||
if (list->item == NULL)
|
||||
continue;
|
||||
new_menu(list->menu, list->item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
setMenuItem(MenuItem *item, char *type, char *line)
|
||||
{
|
||||
|
||||
+1
-5
@@ -1,4 +1,4 @@
|
||||
/* $Id: parsetagx.c,v 1.15 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: parsetagx.c,v 1.16 2006/04/07 13:21:12 inu Exp $ */
|
||||
#include "fm.h"
|
||||
#include "myctype.h"
|
||||
#include "indep.h"
|
||||
@@ -182,8 +182,6 @@ parse_tag(char **s, int internal)
|
||||
while (*q && *q != '"') {
|
||||
if (*q != '\n')
|
||||
Strcat_char(value, *q);
|
||||
else
|
||||
Strcat_char(value, ' ');
|
||||
if (!tag->need_reconstruct && is_html_quote(*q))
|
||||
tag->need_reconstruct = TRUE;
|
||||
q++;
|
||||
@@ -196,8 +194,6 @@ parse_tag(char **s, int internal)
|
||||
while (*q && *q != '\'') {
|
||||
if (*q != '\n')
|
||||
Strcat_char(value, *q);
|
||||
else
|
||||
Strcat_char(value, ' ');
|
||||
if (!tag->need_reconstruct && is_html_quote(*q))
|
||||
tag->need_reconstruct = TRUE;
|
||||
q++;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: proto.h,v 1.100 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: proto.h,v 1.101 2006/04/07 13:21:12 inu Exp $ */
|
||||
/*
|
||||
* This file was automatically generated by version 1.7 of cextract.
|
||||
* Manual editing not recommended.
|
||||
@@ -137,7 +137,6 @@ extern void tabL(void);
|
||||
extern void ldDL(void);
|
||||
extern void linkLst(void);
|
||||
#ifdef USE_MENU
|
||||
extern void interpretAsMenu(void);
|
||||
extern void linkMn(void);
|
||||
extern LinkList *link_menu(Buffer *buf);
|
||||
extern void accessKey(void);
|
||||
@@ -146,7 +145,6 @@ extern void listMn(void);
|
||||
extern void movlistMn(void);
|
||||
extern Anchor *list_menu(Buffer *buf);
|
||||
#else
|
||||
#define interpretAsMenu nulcmd
|
||||
#define linkMn nulcmd
|
||||
#define accessKey nulcmd
|
||||
#define listMn nulcmd
|
||||
@@ -494,9 +492,6 @@ extern void term_title(char *s);
|
||||
extern void flush_tty(void);
|
||||
extern void toggle_stand(void);
|
||||
extern char getch(void);
|
||||
#ifdef USE_REMOTE
|
||||
char getch_select(int fd, int *num);
|
||||
#endif
|
||||
extern void bell(void);
|
||||
extern int sleep_till_anykey(int sec, int purge);
|
||||
#ifdef USE_IMAGE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: rc.c,v 1.100 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: rc.c,v 1.101 2006/04/07 13:21:12 inu Exp $ */
|
||||
/*
|
||||
* Initialization file etc.
|
||||
*/
|
||||
@@ -192,7 +192,6 @@ static int OptionEncode = FALSE;
|
||||
#endif /* USE_SSL */
|
||||
#ifdef USE_COOKIE
|
||||
#define CMT_USECOOKIE N_("Enable cookie processing")
|
||||
#define CMT_SHOWCOOKIE N_("Print a message when receiving a cookie")
|
||||
#define CMT_ACCEPTCOOKIE N_("Accept cookies")
|
||||
#define CMT_ACCEPTBADCOOKIE N_("Action to be taken on invalid cookie")
|
||||
#define CMT_COOKIE_REJECT_DOMAINS N_("Domains to reject cookies from")
|
||||
@@ -302,7 +301,9 @@ static struct sel_c dnsorders[] = {
|
||||
#ifdef USE_COOKIE
|
||||
static struct sel_c badcookiestr[] = {
|
||||
{N_S(ACCEPT_BAD_COOKIE_DISCARD), N_("discard")},
|
||||
#if 0
|
||||
{N_S(ACCEPT_BAD_COOKIE_ACCEPT), N_("accept")},
|
||||
#endif
|
||||
{N_S(ACCEPT_BAD_COOKIE_ASK), N_("ask")},
|
||||
{0, NULL, NULL}
|
||||
};
|
||||
@@ -551,8 +552,6 @@ struct param_ptr params7[] = {
|
||||
#ifdef USE_COOKIE
|
||||
struct param_ptr params8[] = {
|
||||
{"use_cookie", P_INT, PI_ONOFF, (void *)&use_cookie, CMT_USECOOKIE, NULL},
|
||||
{"show_cookie", P_INT, PI_ONOFF, (void *)&show_cookie,
|
||||
CMT_SHOWCOOKIE, NULL},
|
||||
{"accept_cookie", P_INT, PI_ONOFF, (void *)&accept_cookie,
|
||||
CMT_ACCEPTCOOKIE, NULL},
|
||||
{"accept_bad_cookie", P_INT, PI_SEL_C, (void *)&accept_bad_cookie,
|
||||
@@ -1112,11 +1111,7 @@ do_mkdir(const char *dir, long mode)
|
||||
return mkdir(abs, mode);
|
||||
}
|
||||
#else /* not __EMX__ */
|
||||
#ifdef __MINGW32_VERSION
|
||||
#define do_mkdir(dir,mode) mkdir(dir)
|
||||
#else
|
||||
#define do_mkdir(dir,mode) mkdir(dir,mode)
|
||||
#endif /* not __MINW32_VERSION */
|
||||
#endif /* not __EMX__ */
|
||||
|
||||
void
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: table.c,v 1.50 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: table.c,v 1.51 2006/04/07 13:21:12 inu Exp $ */
|
||||
/*
|
||||
* HTML table
|
||||
*/
|
||||
@@ -1984,7 +1984,7 @@ renderTable(struct table *t, int max_width, struct html_feed_environ *h_env)
|
||||
break;
|
||||
}
|
||||
if (t->total_height == 0) {
|
||||
renderbuf = Strnew_charp(" ");
|
||||
renderbuf = Strnew(" ");
|
||||
t->total_height++;
|
||||
t->total_width = 1;
|
||||
push_render_image(renderbuf, 1, t->total_width, h_env);
|
||||
@@ -2465,16 +2465,11 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
|
||||
return TAG_ACTION_PLAIN;
|
||||
}
|
||||
if (mode->pre_mode & TBLM_INTXTA) {
|
||||
switch (cmd) {
|
||||
CASE_TABLE_TAG:
|
||||
case HTML_N_TEXTAREA:
|
||||
if (mode->end_tag == cmd) {
|
||||
table_close_textarea(tbl, mode, width);
|
||||
if (cmd == HTML_N_TEXTAREA)
|
||||
return TAG_ACTION_NONE;
|
||||
break;
|
||||
default:
|
||||
return TAG_ACTION_FEED;
|
||||
return TAG_ACTION_NONE;
|
||||
}
|
||||
return TAG_ACTION_FEED;
|
||||
}
|
||||
if (mode->pre_mode & TBLM_SCRIPT) {
|
||||
if (mode->end_tag == cmd) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: terms.c,v 1.54 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: terms.c,v 1.55 2006/04/07 13:21:12 inu Exp $ */
|
||||
/*
|
||||
* An original curses library for EUC-kanji by Akinori ITO, December 1989
|
||||
* revised by Akinori ITO, January 1995
|
||||
@@ -15,11 +15,7 @@
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#ifndef __MINGW32_VERSION
|
||||
#include <sys/ioctl.h>
|
||||
#else
|
||||
#include <winsock.h>
|
||||
#endif /* __MINGW32_VERSION */
|
||||
#ifdef USE_MOUSE
|
||||
#ifdef USE_GPM
|
||||
#include <gpm.h>
|
||||
@@ -291,42 +287,6 @@ typedef struct sgttyb TerminalMode;
|
||||
#define MODEFLAG(d) ((d).sg_flags)
|
||||
#endif /* HAVE_SGTTY_H */
|
||||
|
||||
#ifdef __MINGW32_VERSION
|
||||
/* dummy struct */
|
||||
typedef unsigned char cc_t;
|
||||
typedef unsigned int speed_t;
|
||||
typedef unsigned int tcflag_t;
|
||||
|
||||
#define NCCS 32
|
||||
struct termios
|
||||
{
|
||||
tcflag_t c_iflag; /* input mode flags */
|
||||
tcflag_t c_oflag; /* output mode flags */
|
||||
tcflag_t c_cflag; /* control mode flags */
|
||||
tcflag_t c_lflag; /* local mode flags */
|
||||
cc_t c_line; /* line discipline */
|
||||
cc_t c_cc[NCCS]; /* control characters */
|
||||
speed_t c_ispeed; /* input speed */
|
||||
speed_t c_ospeed; /* output speed */
|
||||
};
|
||||
typedef struct termios TerminalMode;
|
||||
#define TerminalSet(fd,x) (0)
|
||||
#define TerminalGet(fd,x) (0)
|
||||
#define MODEFLAG(d) (0)
|
||||
|
||||
/* dummy defines */
|
||||
#define SIGHUP (0)
|
||||
#define SIGQUIT (0)
|
||||
#define ECHO (0)
|
||||
#define ISIG (0)
|
||||
#define VEOF (0)
|
||||
#define ICANON (0)
|
||||
#define IXON (0)
|
||||
#define IXOFF (0)
|
||||
|
||||
char *ttyname(int);
|
||||
#endif /* __MINGW32_VERSION */
|
||||
|
||||
#define MAX_LINE 200
|
||||
#define MAX_COLUMN 400
|
||||
|
||||
@@ -551,7 +511,6 @@ set_tty(void)
|
||||
void
|
||||
ttymode_set(int mode, int imode)
|
||||
{
|
||||
#ifndef __MINGW32_VERSION
|
||||
TerminalMode ioval;
|
||||
|
||||
TerminalGet(tty, &ioval);
|
||||
@@ -566,13 +525,11 @@ ttymode_set(int mode, int imode)
|
||||
printf("Error occured while set %x: errno=%d\n", mode, errno);
|
||||
reset_exit(SIGNAL_ARGLIST);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
ttymode_reset(int mode, int imode)
|
||||
{
|
||||
#ifndef __MINGW32_VERSION
|
||||
TerminalMode ioval;
|
||||
|
||||
TerminalGet(tty, &ioval);
|
||||
@@ -587,7 +544,6 @@ ttymode_reset(int mode, int imode)
|
||||
printf("Error occured while reset %x: errno=%d\n", mode, errno);
|
||||
reset_exit(SIGNAL_ARGLIST);
|
||||
}
|
||||
#endif /* __MINGW32_VERSION */
|
||||
}
|
||||
|
||||
#ifndef HAVE_SGTTY_H
|
||||
@@ -1874,44 +1830,6 @@ getch(void)
|
||||
return c;
|
||||
}
|
||||
|
||||
#ifdef USE_REMOTE
|
||||
char
|
||||
getch_select(int fd, int *fdn)
|
||||
{
|
||||
int maxfd = tty;
|
||||
fd_set rset;
|
||||
|
||||
if (fd < 0 || fd == tty) {
|
||||
*fdn = 0;
|
||||
return getch();
|
||||
}
|
||||
|
||||
if (maxfd < fd)
|
||||
maxfd = fd;
|
||||
|
||||
maxfd++;
|
||||
|
||||
FD_ZERO(&rset);
|
||||
FD_SET(tty, &rset);
|
||||
FD_SET(fd, &rset);
|
||||
|
||||
while (select(maxfd, &rset, NULL, NULL, NULL) < 1) {
|
||||
FD_ZERO(&rset);
|
||||
FD_SET(tty, &rset);
|
||||
FD_SET(fd, &rset);
|
||||
}
|
||||
|
||||
if (FD_ISSET(tty, &rset)) {
|
||||
*fdn = 0;
|
||||
return getch();
|
||||
} else if (FD_ISSET(fd, &rset)) {
|
||||
*fdn = 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USE_MOUSE
|
||||
#ifdef USE_GPM
|
||||
char
|
||||
@@ -2254,40 +2172,3 @@ touch_cursor()
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32_VERSION
|
||||
|
||||
int tgetent(char *bp, char *name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tgetnum(char *id)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int tgetflag(char *id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *tgetstr(char *id, char **area)
|
||||
{
|
||||
id = "";
|
||||
}
|
||||
|
||||
char *tgoto(char *cap, int col, int row)
|
||||
{
|
||||
}
|
||||
|
||||
int tputs(char *str, int affcnt, int (*putc)(char))
|
||||
{
|
||||
}
|
||||
|
||||
char *ttyname(int tty)
|
||||
{
|
||||
return "CON";
|
||||
}
|
||||
|
||||
#endif /* __MINGW32_VERSION */
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
/* $Id: url.c,v 1.91 2006/04/05 14:18:54 inu Exp $ */
|
||||
/* $Id: url.c,v 1.92 2006/04/07 13:21:12 inu Exp $ */
|
||||
#include "fm.h"
|
||||
#ifndef __MINGW32_VERSION
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#else
|
||||
#include <winsock.h>
|
||||
#endif /* __MINGW32_VERSION */
|
||||
|
||||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
@@ -35,11 +31,6 @@
|
||||
#define write(a,b,c) write_s(a,b,c)
|
||||
#endif /* __WATT32__ */
|
||||
|
||||
#ifdef __MINGW32_VERSION
|
||||
#define write(a,b,c) send(a,b,c, 0)
|
||||
#define close(fd) closesocket(fd)
|
||||
#endif
|
||||
|
||||
#ifdef INET6
|
||||
/* see rc.c, "dns_order" and dnsorders[] */
|
||||
int ai_family_order_table[7][3] = {
|
||||
|
||||
Reference in New Issue
Block a user