aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/020_debian.patch
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2019-01-05 08:49:33 +0000
committerTatsuya Kinoshita <tats@debian.org>2019-01-05 08:49:33 +0000
commit8d15955f70b7459cde859f5138735f43a91f94a6 (patch)
tree3322a1161d14f1e0815082cdda769db143e2e520 /debian/patches/020_debian.patch
parentMerge remote-tracking branch 'origin/lintian-clean' into debian (diff)
downloadw3m-8d15955f70b7459cde859f5138735f43a91f94a6.tar.gz
w3m-8d15955f70b7459cde859f5138735f43a91f94a6.zip
Update 020_debian.patch to v0.5.3+git20190105
- Respect simple_preserve_space for table cells (closes: #893902) - Fix that the mark_all_pages option works (closes: #911929) - w3mman supports specifying a section number during a keyword search (closes: #916968)
Diffstat (limited to 'debian/patches/020_debian.patch')
-rw-r--r--debian/patches/020_debian.patch2011
1 files changed, 1442 insertions, 569 deletions
diff --git a/debian/patches/020_debian.patch b/debian/patches/020_debian.patch
index b67e317..88ed75d 100644
--- a/debian/patches/020_debian.patch
+++ b/debian/patches/020_debian.patch
@@ -60,10 +60,84 @@ index 8f443c1..5fb6581 100755
$input = "w3m-control: GOTO_LINK";
}
diff --git a/ChangeLog b/ChangeLog
-index 88358ef..b14c60a 100644
+index 88358ef..7367d67 100644
--- a/ChangeLog
+++ b/ChangeLog
-@@ -1,3 +1,1618 @@
+@@ -1,3 +1,1693 @@
++2019-01-05 Tatsuya Kinoshita <tats@debian.org>
++
++ * NEWS: Update NEWS.
++
++ * config.guess, config.sub:
++ Update config.* with autotools-dev 20180224.1.
++
++2019-01-05 Akinori Hattori <hattya@gentoo.org>
++
++ * w3mimg/fb/fb_imlib2.c: Fix dependency for Imlib2.
++ Bug-Gentoo: https://bugs.gentoo.org/605930
++ Origin: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97d6e3e6839898829e8cce211b97a7fa77f5d06e
++
++2018-12-22 Tatsuya Kinoshita <tats@debian.org>
++
++ * scripts/w3mman/w3mman.1.in, scripts/w3mman/w3mman.in:
++ Fix square brackets.
++
++2018-12-21 Nemo Inis <nemoinis@hotmail.com>
++
++ * scripts/w3mman/w3mman.1.in, scripts/w3mman/w3mman.in:
++ * scripts/w3mman/w3mman2html.cgi.in:
++ w3mman support for section number during keyword search.
++ Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916968#5
++
++2018-10-26 Ben Wong <bugs.debian.org@wongs.net>
++
++ * buffer.c, display.c:
++ Fix that the MarkAllPages option works as originally intended.
++ Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911929
++
++2018-10-26 Tatsuya Kinoshita <tats@debian.org>
++
++ * istream.c, url.c: Indentation fix.
++
++2018-10-24 Mark Wright <gienah@gentoo.org>
++
++ * istream.c, url.c: Do not use deprecated features with openssl-1.1.
++ Bug-Gentoo: https://bugs.gentoo.org/592510
++ Bug-Debian: https://github.com/tats/w3m/pull/103
++
++2018-05-20 Andrew Santosa <santosa_1999@yahoo.com>
++
++ * po/Makefile.in.in: Added check for : command not producing .gmo file.
++ Bug-Debian: https://github.com/tats/w3m/pull/99
++
++2018-03-24 Tatsuya Kinoshita <tats@debian.org>
++
++ * table.c: Respect simple_preserve_space for table cells.
++ Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893902
++
++2018-03-23 Mike <barbeque@users.noreply.github.com>
++
++ Update grammar & spelling in some English READMEs.
++ Origin: https://github.com/tats/w3m/pull/97
++
++ * doc/README.img: Update README.img.
++ * doc/README.dict: Update README.dict.
++ * doc/README.pre_form: Update README.pre_form.
++ * doc/README.cookie: Update README.cookie.
++ * doc/README.cookie: Update README.cookie.
++
++2018-03-04 Jia Zhouyang <jiazhouyang@nudt.edu.cn>
++
++ Fix crashes when some external APIs fail.
++ Origin: https://github.com/tats/w3m/pull/96
++
++ * url.c: Add error handling code for fopen.
++ Check the return code of fopen, and return when it fails.
++ * file.c: Add error handling code for fopen.
++ Check the return value of fopen, and add proper error handling code.
++ * local.c: Add error handling for chdir.
++ When chdir fails, print error message and exit.
++
+2018-01-25 Tatsuya Kinoshita <tats@debian.org>
+
+ * ChangeLog, NEWS: Add CVE IDs.
@@ -108,6 +182,7 @@ index 88358ef..b14c60a 100644
+
+ * w3mimg/fb/fb_w3mimg.c: Accept TERM=fbterm.
+ cf. https://bushowhige.blogspot.jp/2015/01/fbterm-w3m-img.html
++ Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590668
+
+2017-12-27 Tatsuya Kinoshita <tats@debian.org>
+
@@ -1734,10 +1809,21 @@ index 7d692f9..453072d 100644
do \
(cd $$dir && $(MAKE) $(MAKE_ARGS) uninstall); \
diff --git a/NEWS b/NEWS
-index 66e309d..4ed621a 100644
+index 66e309d..dac1f5c 100644
--- a/NEWS
+++ b/NEWS
-@@ -1,3 +1,78 @@
+@@ -1,3 +1,89 @@
++Debian's w3m 0.5.3+git20190105
++
++* bug fixes
++ - do not use deprecated features with OpenSSL 1.1
++ - fix dependency for Imlib2
++ - fix that the mark_all_pages option works
++ - respect the simple_preserve_space option for table cells
++ - fix error handling for ~/.w3m/request.log and localcgi_post()
++* new feature
++ - w3mman supports specifying a section number during a keyword search
++
+Debian's w3m 0.5.3+git20180125
+
+* bug fixes
@@ -2300,10 +2386,19 @@ index 27bbd56..b6d121c 100644
"</a><br>", p, "\n", NULL);
}
diff --git a/buffer.c b/buffer.c
-index 5afc26a..3b2352a 100644
+index 5afc26a..e70cffe 100644
--- a/buffer.c
+++ b/buffer.c
-@@ -705,6 +705,7 @@ readBufferCache(Buffer *buf)
+@@ -47,6 +47,8 @@ newBuffer(int width)
+ #ifdef USE_M17N
+ n->auto_detect = WcOption.auto_detect;
+ #endif
++ n->check_url = MarkAllPages; /* use default from -o mark_all_pages */
++ n->need_reshape = 1; /* always reshape new buffers to mark URLs */
+ return n;
+ }
+
+@@ -705,6 +707,7 @@ readBufferCache(Buffer *buf)
cache = fopen(buf->savecache, "r");
if (cache == NULL || fread1(clnum, cache) || fread1(tlnum, cache)) {
@@ -2311,7 +2406,7 @@ index 5afc26a..3b2352a 100644
buf->savecache = NULL;
return -1;
}
-@@ -760,8 +761,10 @@ readBufferCache(Buffer *buf)
+@@ -760,8 +763,10 @@ readBufferCache(Buffer *buf)
}
#endif
}
@@ -2325,7 +2420,7 @@ index 5afc26a..3b2352a 100644
unlink(buf->savecache);
buf->savecache = NULL;
diff --git a/config.guess b/config.guess
-index 51fab47..31e01ef 100755
+index 51fab47..f50dcdb 100755
--- a/config.guess
+++ b/config.guess
@@ -1,13 +1,12 @@
@@ -2333,10 +2428,10 @@ index 51fab47..31e01ef 100755
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-+# Copyright 1992-2017 Free Software Foundation, Inc.
++# Copyright 1992-2018 Free Software Foundation, Inc.
-timestamp='2004-03-12'
-+timestamp='2017-11-07'
++timestamp='2018-02-24'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -2395,7 +2490,7 @@ index 51fab47..31e01ef 100755
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-+Copyright 1992-2017 Free Software Foundation, Inc.
++Copyright 1992-2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -2414,7 +2509,7 @@ index 51fab47..31e01ef 100755
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
-@@ -104,7 +100,7 @@ set_cc_for_build='
+@@ -104,16 +100,16 @@ set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
@@ -2423,6 +2518,17 @@ index 51fab47..31e01ef 100755
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+ dummy=$tmp/dummy ;
+ tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+ case $CC_FOR_BUILD,$HOST_CC,$CC in
+- ,,) echo "int x;" > $dummy.c ;
++ ,,) echo "int x;" > "$dummy.c" ;
+ for c in cc gcc c89 c99 ; do
+- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
++ if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
@@ -123,7 +119,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
;;
,,*) CC_FOR_BUILD=$CC ;;
@@ -2432,18 +2538,18 @@ index 51fab47..31e01ef 100755
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
-@@ -136,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+@@ -136,12 +132,40 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-+case "${UNAME_SYSTEM}" in
++case "$UNAME_SYSTEM" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
-+ eval $set_cc_for_build
-+ cat <<-EOF > $dummy.c
++ eval "$set_cc_for_build"
++ cat <<-EOF > "$dummy.c"
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
@@ -2453,13 +2559,21 @@ index 51fab47..31e01ef 100755
+ LIBC=gnu
+ #endif
+ EOF
-+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
++ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
++
++ # If ldd exists, use it to detect musl libc.
++ if command -v ldd >/dev/null && \
++ ldd --version 2>&1 | grep -q ^musl
++ then
++ LIBC=musl
++ fi
+ ;;
+esac
+
# Note: order is significant - the case branches are not exclusive.
- case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
++case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -2467,45 +2581,49 @@ index 51fab47..31e01ef 100755
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
-@@ -151,22 +168,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -151,22 +175,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+- case "${UNAME_MACHINE_ARCH}" in
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
-+ /sbin/$sysctl 2>/dev/null || \
-+ /usr/sbin/$sysctl 2>/dev/null || \
++ "/sbin/$sysctl" 2>/dev/null || \
++ "/usr/sbin/$sysctl" 2>/dev/null || \
+ echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
++ case "$UNAME_MACHINE_ARCH" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
+- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ earmv*)
-+ arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
-+ endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
-+ machine=${arch}${endian}-unknown
++ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
++ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
++ machine="${arch}${endian}"-unknown
+ ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
++ *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
esac
# The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
+- case "${UNAME_MACHINE_ARCH}" in
+ # to ELF recently (or will in the future) and ABI.
- case "${UNAME_MACHINE_ARCH}" in
++ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ os=netbsdelf
+ ;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
+- eval $set_cc_for_build
++ eval "$set_cc_for_build"
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
+ | grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
-@@ -176,7 +204,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -176,7 +211,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
fi
;;
*)
@@ -2514,19 +2632,25 @@ index 51fab47..31e01ef 100755
+ ;;
+ esac
+ # Determine ABI tags.
-+ case "${UNAME_MACHINE_ARCH}" in
++ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
-+ abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
++ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
;;
esac
# The OS release
-@@ -189,78 +224,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -184,83 +226,62 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+- case "${UNAME_VERSION}" in
++ case "$UNAME_VERSION" in
+ Debian*)
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-+ release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
++ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
@@ -2579,47 +2703,52 @@ index 51fab47..31e01ef 100755
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
-+ echo "${machine}-${os}${release}${abi}"
++ echo "$machine-${os}${release}${abi}"
+ exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
++ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
+ exit ;;
*:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
++ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
+ exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
-+ echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
++ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+ exit ;;
+ *:MidnightBSD:*:*)
-+ echo ${UNAME_MACHINE}-unknown-midnightbsd${UNAME_RELEASE}
++ echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
+ exit ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit 0 ;;
++ echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
+ exit ;;
+ *:SolidBSD:*:*)
-+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
++ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
+ exit ;;
macppc:MirBSD:*:*)
- echo powerppc-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
-+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
++ echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
+ exit ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
++ echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
+ exit ;;
+ *:Sortix:*:*)
-+ echo ${UNAME_MACHINE}-unknown-sortix
++ echo "$UNAME_MACHINE"-unknown-sortix
+ exit ;;
+ *:Redox:*:*)
-+ echo ${UNAME_MACHINE}-unknown-redox
++ echo "$UNAME_MACHINE"-unknown-redox
+ exit ;;
++ mips:OSF1:*.*)
++ echo mips-dec-osf1
++ exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
@@ -2631,7 +2760,7 @@ index 51fab47..31e01ef 100755
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
-@@ -270,76 +281,73 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -270,76 +291,73 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
@@ -2699,7 +2828,7 @@ index 51fab47..31e01ef 100755
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
-+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
++ echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
@@ -2709,12 +2838,14 @@ index 51fab47..31e01ef 100755
- exit 0;;
+ exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
+- echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
++ echo "$UNAME_MACHINE"-unknown-amigaos
+ exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
+- echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
++ echo "$UNAME_MACHINE"-unknown-morphos
+ exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
@@ -2729,8 +2860,9 @@ index 51fab47..31e01ef 100755
+ echo powerpc-ibm-os400
+ exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
+- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
++ echo arm-acorn-riscix"$UNAME_RELEASE"
+ exit ;;
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ echo arm-unknown-riscos
@@ -2742,7 +2874,7 @@ index 51fab47..31e01ef 100755
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
-@@ -347,32 +355,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -347,32 +365,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
else
echo pyramid-pyramid-bsd
fi
@@ -2763,24 +2895,26 @@ index 51fab47..31e01ef 100755
+ sparc) echo sparc-icl-nx7; exit ;;
esac ;;
+ s390x:SunOS:*:*)
-+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++ echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+ exit ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
++ echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
++ echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-+ echo i386-pc-auroraux${UNAME_RELEASE}
++ echo i386-pc-auroraux"$UNAME_RELEASE"
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-+ eval $set_cc_for_build
++ eval "$set_cc_for_build"
+ SUN_ARCH=i386
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
@@ -2793,108 +2927,127 @@ index 51fab47..31e01ef 100755
+ SUN_ARCH=x86_64
+ fi
+ fi
-+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++ echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
++ echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
-@@ -381,13 +408,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -380,26 +417,26 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ ;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
++ echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
+ exit ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
+- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
++ echo m68k-sun-sunos"$UNAME_RELEASE"
+ exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
-+ test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
++ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
-@@ -396,10 +423,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- echo sparc-sun-sunos${UNAME_RELEASE}
+- echo m68k-sun-sunos${UNAME_RELEASE}
++ echo m68k-sun-sunos"$UNAME_RELEASE"
+ ;;
+ sun4)
+- echo sparc-sun-sunos${UNAME_RELEASE}
++ echo sparc-sun-sunos"$UNAME_RELEASE"
;;
esac
- exit 0 ;;
+ exit ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
+- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
++ echo sparc-auspex-sunos"$UNAME_RELEASE"
+ exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
-@@ -409,41 +436,41 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -409,44 +446,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
-+ echo m68k-atari-mint${UNAME_RELEASE}
++ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
++ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
-+ echo m68k-atari-mint${UNAME_RELEASE}
++ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
-+ echo m68k-milan-mint${UNAME_RELEASE}
++ echo m68k-milan-mint"$UNAME_RELEASE"
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
-+ echo m68k-hades-mint${UNAME_RELEASE}
++ echo m68k-hades-mint"$UNAME_RELEASE"
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
-+ echo m68k-unknown-mint${UNAME_RELEASE}
++ echo m68k-unknown-mint"$UNAME_RELEASE"
+ exit ;;
m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
+- echo m68k-apple-machten${UNAME_RELEASE}
- exit 0 ;;
++ echo m68k-apple-machten"$UNAME_RELEASE"
+ exit ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
+- echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
++ echo powerpc-apple-machten"$UNAME_RELEASE"
+ exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
- exit 0 ;;
+ exit ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
+- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
++ echo mips-dec-ultrix"$UNAME_RELEASE"
+ exit ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
+- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
++ echo vax-dec-ultrix"$UNAME_RELEASE"
+ exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
+- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
++ echo clipper-intergraph-clix"$UNAME_RELEASE"
+ exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-@@ -455,47 +482,48 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+- eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
++ eval "$set_cc_for_build"
++ sed 's/^ //' << EOF > "$dummy.c"
+ #ifdef __cplusplus
+ #include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+@@ -455,94 +492,95 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
@@ -2916,12 +3069,13 @@ index 51fab47..31e01ef 100755
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
-+ $CC_FOR_BUILD -o $dummy $dummy.c &&
-+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-+ SYSTEM_NAME=`$dummy $dummyarg` &&
-+ { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
+- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
++ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
++ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
++ SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
++ { echo "$SYSTEM_NAME"; exit; }
++ echo mips-mips-riscos"$UNAME_RELEASE"
+ exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
@@ -2954,14 +3108,25 @@ index 51fab47..31e01ef 100755
AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
+- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
++ if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-@@ -508,29 +536,29 @@ EOF
+- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+- [ ${TARGET_BINARY_INTERFACE}x = x ]
++ if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
++ [ "$TARGET_BINARY_INTERFACE"x = x ]
+ then
+- echo m88k-dg-dgux${UNAME_RELEASE}
++ echo m88k-dg-dgux"$UNAME_RELEASE"
+ else
+- echo m88k-dg-dguxbcs${UNAME_RELEASE}
++ echo m88k-dg-dguxbcs"$UNAME_RELEASE"
+ fi
else
- echo i586-dg-dgux${UNAME_RELEASE}
+- echo i586-dg-dgux${UNAME_RELEASE}
++ echo i586-dg-dgux"$UNAME_RELEASE"
fi
- exit 0 ;;
+ exit ;;
@@ -2983,8 +3148,9 @@ index 51fab47..31e01ef 100755
- exit 0 ;;
+ exit ;;
*:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
++ echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
+ exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
@@ -2998,22 +3164,30 @@ index 51fab47..31e01ef 100755
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
-@@ -538,7 +566,7 @@ EOF
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ else
+- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
++ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
++ echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
+ exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
-@@ -553,125 +581,140 @@ EOF
+- eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
++ eval "$set_cc_for_build"
++ sed 's/^ //' << EOF > "$dummy.c"
+ #include <sys/systemcfg.h>
+
+ main()
+@@ -553,128 +591,143 @@ EOF
exit(0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
-+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
++ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
+ then
+ echo "$SYSTEM_NAME"
+ else
@@ -3029,7 +3203,8 @@ index 51fab47..31e01ef 100755
+ exit ;;
+ *:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
++ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@@ -3040,10 +3215,12 @@ index 51fab47..31e01ef 100755
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
++ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
++ echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
+ exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
@@ -3055,8 +3232,9 @@ index 51fab47..31e01ef 100755
- exit 0 ;;
+ exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
++ echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
@@ -3075,10 +3253,12 @@ index 51fab47..31e01ef 100755
- exit 0 ;;
+ exit ;;
9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
+- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
++ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
++ case "$UNAME_MACHINE" in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
@@ -3096,21 +3276,23 @@ index 51fab47..31e01ef 100755
- esac ;;
- esac
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-+ case "${sc_cpu_version}" in
++ case "$sc_cpu_version" in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
-+ case "${sc_kernel_bits}" in
++ case "$sc_kernel_bits" in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
+ esac ;;
+ esac
fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
+- if [ "${HP_ARCH}" = "" ]; then
+- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-+ sed 's/^ //' << EOF >$dummy.c
++ if [ "$HP_ARCH" = "" ]; then
++ eval "$set_cc_for_build"
++ sed 's/^ //' << EOF > "$dummy.c"
- #define _HPUX_SOURCE
- #include <stdlib.h>
@@ -3172,17 +3354,17 @@ index 51fab47..31e01ef 100755
+ }
EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
-+ (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
++ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
-+ if [ ${HP_ARCH} = hppa2.0w ]
++ if [ "$HP_ARCH" = hppa2.0w ]
then
- # avoid double evaluation of $set_cc_for_build
- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
-+ eval $set_cc_for_build
++ eval "$set_cc_for_build"
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -3203,23 +3385,31 @@ index 51fab47..31e01ef 100755
+ HP_ARCH=hppa64
fi
fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
++ echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
+ exit ;;
ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
+- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+- echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
++ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
++ echo ia64-hp-hpux"$HPUX_REV"
+ exit ;;
3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-@@ -699,356 +742,356 @@ EOF
+- eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
++ eval "$set_cc_for_build"
++ sed 's/^ //' << EOF > "$dummy.c"
+ #include <unistd.h>
+ int
+ main ()
+@@ -699,360 +752,364 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
-+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
++ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
+ { echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
- exit 0 ;;
@@ -3248,9 +3438,11 @@ index 51fab47..31e01ef 100755
+ exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+- echo ${UNAME_MACHINE}-unknown-osf1mk
++ echo "$UNAME_MACHINE"-unknown-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+- echo ${UNAME_MACHINE}-unknown-osf1
++ echo "$UNAME_MACHINE"-unknown-osf1
fi
- exit 0 ;;
+ exit ;;
@@ -3282,32 +3474,37 @@ index 51fab47..31e01ef 100755
- exit 0 ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
++ echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
++ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
++ echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
++ echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
++ echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
*:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
-+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
@@ -3317,7 +3514,7 @@ index 51fab47..31e01ef 100755
- exit 0 ;;
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
++ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
5000:UNIX_System_V:4.*:*)
@@ -3326,20 +3523,23 @@ index 51fab47..31e01ef 100755
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
++ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
++ echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
+ exit ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
+- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
++ echo sparc-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
++ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
*:FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
@@ -3359,31 +3559,33 @@ index 51fab47..31e01ef 100755
- echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
- exit 0 ;;
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
-+ case ${UNAME_PROCESSOR} in
++ case "$UNAME_PROCESSOR" in
+ amd64)
+ UNAME_PROCESSOR=x86_64 ;;
+ i386)
+ UNAME_PROCESSOR=i586 ;;
+ esac
-+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
++ echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
+ exit ;;
i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
+- echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
- i*:MINGW*:*)
+- echo ${UNAME_MACHINE}-pc-mingw32
+- exit 0 ;;
++ echo "$UNAME_MACHINE"-pc-cygwin
+ exit ;;
+ *:MINGW64*:*)
-+ echo ${UNAME_MACHINE}-pc-mingw64
++ echo "$UNAME_MACHINE"-pc-mingw64
+ exit ;;
+ *:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
-- exit 0 ;;
++ echo "$UNAME_MACHINE"-pc-mingw32
+ exit ;;
+ *:MSYS*:*)
-+ echo ${UNAME_MACHINE}-pc-msys
++ echo "$UNAME_MACHINE"-pc-msys
+ exit ;;
i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
+- echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- x86:Interix*:[34]*)
- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
@@ -3397,55 +3599,59 @@ index 51fab47..31e01ef 100755
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit 0 ;;
++ echo "$UNAME_MACHINE"-pc-pw32
+ exit ;;
+ *:Interix*:*)
-+ case ${UNAME_MACHINE} in
++ case "$UNAME_MACHINE" in
+ x86)
-+ echo i586-pc-interix${UNAME_RELEASE}
++ echo i586-pc-interix"$UNAME_RELEASE"
+ exit ;;
+ authenticamd | genuineintel | EM64T)
-+ echo x86_64-unknown-interix${UNAME_RELEASE}
++ echo x86_64-unknown-interix"$UNAME_RELEASE"
+ exit ;;
+ IA64)
-+ echo ia64-unknown-interix${UNAME_RELEASE}
++ echo ia64-unknown-interix"$UNAME_RELEASE"
+ exit ;;
+ esac ;;
i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
+- echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit 0 ;;
++ echo "$UNAME_MACHINE"-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
++ echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
-+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
++ echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
+ exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit 0 ;;
-+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
++ echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
+ exit ;;
i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
+- echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
++ echo "$UNAME_MACHINE"-pc-minix
+ exit ;;
+ aarch64:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -3459,74 +3665,76 @@ index 51fab47..31e01ef 100755
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
-+ eval $set_cc_for_build
++ eval "$set_cc_for_build"
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
+ else
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit 0 ;;
-+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
++ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+ exit ;;
+ crisv32:Linux:*:*)
-+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
++ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+ exit ;;
+ e2k:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ frv:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ hexagon:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ i*86:Linux:*:*)
-+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
++ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
+ exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ k1om:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- mips:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+- eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
++ eval "$set_cc_for_build"
++ sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
- #undef mips
- #undef mipsel
@@ -3546,8 +3754,8 @@ index 51fab47..31e01ef 100755
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
-+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
++ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
++ test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
@@ -3589,19 +3797,19 @@ index 51fab47..31e01ef 100755
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
+ mips64el:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ openrisc*:Linux:*:*)
-+ echo or1k-unknown-linux-${LIBC}
++ echo or1k-unknown-linux-"$LIBC"
+ exit ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ padre:Linux:*:*)
-+ echo sparc-unknown-linux-${LIBC}
++ echo sparc-unknown-linux-"$LIBC"
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
-+ echo hppa64-unknown-linux-${LIBC}
++ echo hppa64-unknown-linux-"$LIBC"
+ exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
@@ -3609,9 +3817,9 @@ index 51fab47..31e01ef 100755
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
-+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
-+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
-+ *) echo hppa-unknown-linux-${LIBC} ;;
++ PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
++ PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
++ *) echo hppa-unknown-linux-"$LIBC" ;;
esac
- exit 0 ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
@@ -3619,45 +3827,45 @@ index 51fab47..31e01ef 100755
- exit 0 ;;
+ exit ;;
+ ppc64:Linux:*:*)
-+ echo powerpc64-unknown-linux-${LIBC}
++ echo powerpc64-unknown-linux-"$LIBC"
+ exit ;;
+ ppc:Linux:*:*)
-+ echo powerpc-unknown-linux-${LIBC}
++ echo powerpc-unknown-linux-"$LIBC"
+ exit ;;
+ ppc64le:Linux:*:*)
-+ echo powerpc64le-unknown-linux-${LIBC}
++ echo powerpc64le-unknown-linux-"$LIBC"
+ exit ;;
+ ppcle:Linux:*:*)
-+ echo powerpcle-unknown-linux-${LIBC}
++ echo powerpcle-unknown-linux-"$LIBC"
+ exit ;;
+ riscv32:Linux:*:* | riscv64:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
-+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
++ echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
+ exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ tile*:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ vax:Linux:*:*)
-+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
++ echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
+ exit ;;
x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
@@ -3718,10 +3926,14 @@ index 51fab47..31e01ef 100755
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
- ;;
-+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
++ if objdump -f /bin/sh | grep -q elf32-x86-64; then
++ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
++ else
++ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
++ fi
+ exit ;;
+ xtensa*:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -3739,45 +3951,55 @@ index 51fab47..31e01ef 100755
+ # I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
-+ # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
++ # Use sysv4.2uw... so that sysv4* matches it.
++ echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
+ exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
+- echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
++ echo "$UNAME_MACHINE"-pc-os2-emx
+ exit ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
+- echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
++ echo "$UNAME_MACHINE"-unknown-stop
+ exit ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
+- echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
- i*86:syllable:*:*)
-+ exit ;;
-+ i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
+- echo ${UNAME_MACHINE}-pc-syllable
- exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+- echo i386-unknown-lynxos${UNAME_RELEASE}
+- exit 0 ;;
++ echo "$UNAME_MACHINE"-unknown-atheos
++ exit ;;
++ i*86:syllable:*:*)
++ echo "$UNAME_MACHINE"-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
-- exit 0 ;;
++ echo i386-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
+- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
++ echo "$UNAME_MACHINE"-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
++ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
++ echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
++ echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
fi
- exit 0 ;;
- i*86:*:5:[78]*)
@@ -3789,15 +4011,27 @@ index 51fab47..31e01ef 100755
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
++ echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
+ exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-@@ -1066,73 +1109,86 @@ EOF
+- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
++ echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+@@ -1062,369 +1119,333 @@ EOF
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
++ echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv32
+- echo ${UNAME_MACHINE}-pc-sysv32
++ echo "$UNAME_MACHINE"-pc-sysv32
fi
- exit 0 ;;
+ exit ;;
@@ -3824,9 +4058,11 @@ index 51fab47..31e01ef 100755
+ exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
++ echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
++ echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
fi
- exit 0 ;;
+ exit ;;
@@ -3854,10 +4090,10 @@ index 51fab47..31e01ef 100755
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
-+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
++ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
-+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
++ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
@@ -3868,35 +4104,40 @@ index 51fab47..31e01ef 100755
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
++ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
++ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
++ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
+- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
++ echo m68k-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
- exit 0 ;;
+ exit ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
+- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
++ echo sparc-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
+- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+- echo powerpc-unknown-lynxos${UNAME_RELEASE}
+- exit 0 ;;
++ echo rs6000-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
-- exit 0 ;;
++ echo powerpc-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
+- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
++ echo mips-dde-sysv"$UNAME_RELEASE"
+ exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
@@ -3909,7 +4150,8 @@ index 51fab47..31e01ef 100755
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
-@@ -1140,291 +1196,239 @@ EOF
+- echo ${UNAME_MACHINE}-sni-sysv4
++ echo "$UNAME_MACHINE"-sni-sysv4
else
echo ns32k-sni-sysv
fi
@@ -3936,7 +4178,7 @@ index 51fab47..31e01ef 100755
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
-+ echo ${UNAME_MACHINE}-stratus-vos
++ echo "$UNAME_MACHINE"-stratus-vos
+ exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
@@ -3944,8 +4186,9 @@ index 51fab47..31e01ef 100755
- exit 0 ;;
+ exit ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
+- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
++ echo m68k-apple-aux"$UNAME_RELEASE"
+ exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
@@ -3954,10 +4197,10 @@ index 51fab47..31e01ef 100755
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
-+ echo mips-nec-sysv${UNAME_RELEASE}
++ echo mips-nec-sysv"$UNAME_RELEASE"
else
- echo mips-unknown-sysv${UNAME_RELEASE}
-+ echo mips-unknown-sysv${UNAME_RELEASE}
++ echo mips-unknown-sysv"$UNAME_RELEASE"
fi
- exit 0 ;;
+ exit ;;
@@ -3980,48 +4223,55 @@ index 51fab47..31e01ef 100755
+ echo x86_64-unknown-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
+- echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
++ echo sx4-nec-superux"$UNAME_RELEASE"
+ exit ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
+- echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
++ echo sx5-nec-superux"$UNAME_RELEASE"
+ exit ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
+- echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
++ echo sx6-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-7:SUPER-UX:*:*)
-+ echo sx7-nec-superux${UNAME_RELEASE}
++ echo sx7-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-8:SUPER-UX:*:*)
-+ echo sx8-nec-superux${UNAME_RELEASE}
++ echo sx8-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
-+ echo sx8r-nec-superux${UNAME_RELEASE}
++ echo sx8r-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-ACE:SUPER-UX:*:*)
-+ echo sxace-nec-superux${UNAME_RELEASE}
++ echo sxace-nec-superux"$UNAME_RELEASE"
+ exit ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
+- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
++ echo powerpc-apple-rhapsody"$UNAME_RELEASE"
+ exit ;;
*:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
++ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
+ exit ;;
*:Darwin:*:*)
- case `uname -p` in
- *86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
- esac
+- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+- exit 0 ;;
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-+ eval $set_cc_for_build
++ eval "$set_cc_for_build"
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
-+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
++ if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
@@ -4049,8 +4299,7 @@ index 51fab47..31e01ef 100755
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
+ fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-- exit 0 ;;
++ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
+ exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
@@ -4059,26 +4308,31 @@ index 51fab47..31e01ef 100755
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
++ echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
+ exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
- exit 0 ;;
- NSR-?:NONSTOP_KERNEL:*:*)
+- echo nsr-tandem-nsk${UNAME_RELEASE}
+- exit 0 ;;
+ exit ;;
+ NEO-*:NONSTOP_KERNEL:*:*)
-+ echo neo-tandem-nsk${UNAME_RELEASE}
++ echo neo-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
-+ echo nse-tandem-nsk${UNAME_RELEASE}
++ echo nse-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSR-*:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
-- exit 0 ;;
++ echo nsr-tandem-nsk"$UNAME_RELEASE"
++ exit ;;
++ NSV-*:NONSTOP_KERNEL:*:*)
++ echo nsv-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSX-*:NONSTOP_KERNEL:*:*)
-+ echo nsx-tandem-nsk${UNAME_RELEASE}
++ echo nsx-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
@@ -4089,8 +4343,9 @@ index 51fab47..31e01ef 100755
- exit 0 ;;
+ exit ;;
DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
++ echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
+ exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
@@ -4102,8 +4357,9 @@ index 51fab47..31e01ef 100755
else
UNAME_MACHINE="$cputype"
fi
- echo ${UNAME_MACHINE}-unknown-plan9
+- echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
++ echo "$UNAME_MACHINE"-unknown-plan9
+ exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
@@ -4132,15 +4388,16 @@ index 51fab47..31e01ef 100755
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit 0 ;;
-+ echo mips-sei-seiux${UNAME_RELEASE}
++ echo mips-sei-seiux"$UNAME_RELEASE"
+ exit ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
++ echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
-+ case "${UNAME_MACHINE}" in
++ case "$UNAME_MACHINE" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
@@ -4149,16 +4406,16 @@ index 51fab47..31e01ef 100755
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
-+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
++ echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
+ exit ;;
+ i*86:rdos:*:*)
-+ echo ${UNAME_MACHINE}-pc-rdos
++ echo "$UNAME_MACHINE"-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
-+ echo ${UNAME_MACHINE}-pc-aros
++ echo "$UNAME_MACHINE"-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
-+ echo ${UNAME_MACHINE}-unknown-esx
++ echo "$UNAME_MACHINE"-unknown-esx
+ exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
@@ -4167,7 +4424,8 @@ index 51fab47..31e01ef 100755
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
--
++echo "$0: unable to guess system type" >&2
+
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
@@ -4200,7 +4458,11 @@ index 51fab47..31e01ef 100755
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
--
++case "$UNAME_MACHINE:$UNAME_SYSTEM" in
++ mips:Linux | mips64:Linux)
++ # If we got here on MIPS GNU/Linux, output extra information.
++ cat >&2 <<EOF
+
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
@@ -4229,8 +4491,7 @@ index 51fab47..31e01ef 100755
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-+echo "$0: unable to guess system type" >&2
-
+-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
@@ -4244,11 +4505,7 @@ index 51fab47..31e01ef 100755
- struct utsname un;
-
- uname(&un);
-+case "${UNAME_MACHINE}:${UNAME_SYSTEM}" in
-+ mips:Linux | mips64:Linux)
-+ # If we got here on MIPS GNU/Linux, output extra information.
-+ cat >&2 <<EOF
-
+-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
@@ -4349,7 +4606,20 @@ index 51fab47..31e01ef 100755
config.guess timestamp = $timestamp
-@@ -1452,7 +1456,7 @@ EOF
+@@ -1443,16 +1464,16 @@ hostinfo = `(hostinfo) 2>/dev/null`
+ /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+ /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+-UNAME_MACHINE = ${UNAME_MACHINE}
+-UNAME_RELEASE = ${UNAME_RELEASE}
+-UNAME_SYSTEM = ${UNAME_SYSTEM}
+-UNAME_VERSION = ${UNAME_VERSION}
++UNAME_MACHINE = "$UNAME_MACHINE"
++UNAME_RELEASE = "$UNAME_RELEASE"
++UNAME_SYSTEM = "$UNAME_SYSTEM"
++UNAME_VERSION = "$UNAME_VERSION"
+ EOF
+
exit 1
# Local variables:
@@ -4424,7 +4694,7 @@ index 2f41eed..6ab3008 100644
#define DEFAULT_TERM "dosansi"
#else
diff --git a/config.sub b/config.sub
-index ba33103..00f68b8 100755
+index ba33103..1d8e98b 100755
--- a/config.sub
+++ b/config.sub
@@ -1,42 +1,40 @@
@@ -4432,10 +4702,10 @@ index ba33103..00f68b8 100755
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-+# Copyright 1992-2017 Free Software Foundation, Inc.
++# Copyright 1992-2018 Free Software Foundation, Inc.
-timestamp='2004-03-12'
-+timestamp='2017-11-23'
++timestamp='2018-02-22'
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
@@ -4510,7 +4780,7 @@ index ba33103..00f68b8 100755
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-+Copyright 1992-2017 Free Software Foundation, Inc.
++Copyright 1992-2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -4529,18 +4799,23 @@ index ba33103..00f68b8 100755
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
-@@ -99,7 +95,7 @@ while test $# -gt 0 ; do
+@@ -98,8 +94,8 @@ while test $# -gt 0 ; do
+
*local*)
# First pass through any local machine types.
- echo $1
+- echo $1
- exit 0;;
++ echo "$1"
+ exit ;;
* )
break ;;
-@@ -118,11 +114,18 @@ esac
+@@ -116,17 +112,24 @@ esac
+
+ # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
++maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
- kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
@@ -4550,15 +4825,23 @@ index ba33103..00f68b8 100755
+ kopensolaris*-gnu* | cloudabi*-eabi* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
+- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
++ basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
++ ;;
+ android-linux)
+ os=-linux-android
-+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-+ ;;
++ basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
*)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
+- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+- if [ $basic_machine != $1 ]
+- then os=`echo $1 | sed 's/.*-/-/'`
++ basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
++ if [ "$basic_machine" != "$1" ]
++ then os=`echo "$1" | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+ esac
@@ -145,10 +148,13 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
@@ -4574,7 +4857,7 @@ index ba33103..00f68b8 100755
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
-@@ -163,13 +169,17 @@ case $os in
+@@ -163,54 +169,65 @@ case $os in
os=-chorusos
basic_machine=$1
;;
@@ -4590,45 +4873,72 @@ index ba33103..00f68b8 100755
;;
+ -sco6)
+ os=-sco5v6
-+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
-sco5)
os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-@@ -186,6 +196,10 @@ case $os in
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
+ -sco4)
+ os=-sco3.2v4
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
++ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
-+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-+ ;;
++ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
-sco*)
os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-@@ -203,15 +217,18 @@ case $os in
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
++ ;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
-+ ;;
+ ;;
-lynx*)
os=-lynxos
;;
-ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
-- ;;
++ basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
+ ;;
-psos*)
os=-psos
- ;;
-@@ -227,57 +244,115 @@ case $basic_machine in
+@@ -227,56 +244,114 @@ case $basic_machine in
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
@@ -4690,9 +5000,10 @@ index ba33103..00f68b8 100755
+ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
- | openrisc | or32 \
-+ | open8 | or1k | or1knd | or32 \
- | pdp10 | pdp11 | pj | pjl \
+- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
++ | open8 | or1k | or1knd | or32 \
++ | pdp10 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pru \
| pyramid \
@@ -4719,10 +5030,8 @@ index ba33103..00f68b8 100755
+ | wasm32 \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
-- m6811 | m68hc11 | m6812 | m68hc12)
-- # Motorola 68HC11/12.
++ basic_machine=$basic_machine-unknown
++ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
@@ -4737,32 +5046,41 @@ index ba33103..00f68b8 100755
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
++ os=-none
++ ;;
++ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
++ ;;
+ ms1)
+ basic_machine=mt-unknown
-+ ;;
+ ;;
+- m6811 | m68hc11 | m6812 | m68hc12)
+- # Motorola 68HC11/12.
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
-+ basic_machine=$basic_machine-unknown
-+ os=-none
-+ ;;
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
-+ ;;
+ ;;
# We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
-@@ -293,59 +368,91 @@ case $basic_machine in
+@@ -287,70 +362,102 @@ case $basic_machine in
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
++ echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
+ exit 1
+ ;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
@@ -4876,6 +5194,12 @@ index ba33103..00f68b8 100755
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+- basic_machine=i386-unknown
++ basic_machine=i386-pc
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
@@ -363,7 +470,7 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
@@ -4885,6 +5209,15 @@ index ba33103..00f68b8 100755
basic_machine=abacus-unknown
;;
adobe68k)
+@@ -384,7 +491,7 @@ case $basic_machine in
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
@@ -409,6 +516,13 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-bsd
@@ -4908,7 +5241,7 @@ index ba33103..00f68b8 100755
+ os=-linux
+ ;;
+ blackfin-*)
-+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
@@ -4916,13 +5249,13 @@ index ba33103..00f68b8 100755
+ os=-cnk
+ ;;
+ c54x-*)
-+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
-+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
-+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
c90)
basic_machine=c90-cray
@@ -4984,39 +5317,76 @@ index ba33103..00f68b8 100755
+ os=$os"spe"
+ ;;
+ e500v[12]-*)
-+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=$os"spe"
+ ;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
-@@ -592,7 +754,6 @@ case $basic_machine in
+@@ -578,9 +740,6 @@ case $basic_machine in
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+- hppa-next)
+- os=-nextstep3
+- ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+@@ -592,28 +751,27 @@ case $basic_machine in
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-sysv32
-@@ -631,6 +792,17 @@ case $basic_machine in
+ ;;
+ i*86v4*)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+- i386-vsta | vsta)
++ vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+@@ -631,8 +789,16 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
+- m88k-omron*)
+- basic_machine=m88k-omron
+ leon-*|leon[3-9]-*)
-+ basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
++ basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
-+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=-linux
-+ ;;
- m88k-omron*)
- basic_machine=m88k-omron
;;
-@@ -642,10 +814,21 @@ case $basic_machine in
+ magnum | m3230)
+ basic_machine=mips-mips
+@@ -642,10 +808,21 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
@@ -5039,18 +5409,24 @@ index ba33103..00f68b8 100755
miniframe)
basic_machine=m68000-convergent
;;
-@@ -659,10 +842,6 @@ case $basic_machine in
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+@@ -654,14 +831,10 @@ case $basic_machine in
+ os=-mint
;;
+ mips3*-*)
+- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
++ basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+- ;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
-- ;;
++ basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
+ ;;
monitor)
basic_machine=m68k-rom68k
- os=-coff
-@@ -671,14 +850,29 @@ case $basic_machine in
+@@ -671,14 +844,29 @@ case $basic_machine in
basic_machine=powerpc-unknown
os=-morphos
;;
@@ -5063,7 +5439,7 @@ index ba33103..00f68b8 100755
os=-msdos
;;
+ ms1-*)
-+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
++ basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
+ ;;
+ msys)
+ basic_machine=i686-pc
@@ -5080,7 +5456,7 @@ index ba33103..00f68b8 100755
ncr3000)
basic_machine=i486-ncr
os=-sysv4
-@@ -707,7 +901,7 @@ case $basic_machine in
+@@ -707,7 +895,7 @@ case $basic_machine in
basic_machine=v70-nec
os=-sysv
;;
@@ -5089,7 +5465,7 @@ index ba33103..00f68b8 100755
basic_machine=m68k-next
case $os in
-nextstep* )
-@@ -743,20 +937,24 @@ case $basic_machine in
+@@ -743,20 +931,27 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
@@ -5105,6 +5481,9 @@ index ba33103..00f68b8 100755
nsr-tandem)
basic_machine=nsr-tandem
;;
++ nsv-tandem)
++ basic_machine=nsv-tandem
++ ;;
+ nsx-tandem)
+ basic_machine=nsx-tandem
+ ;;
@@ -5119,7 +5498,7 @@ index ba33103..00f68b8 100755
;;
os400)
basic_machine=powerpc-ibm
-@@ -778,6 +976,14 @@ case $basic_machine in
+@@ -778,6 +973,14 @@ case $basic_machine in
basic_machine=i860-intel
os=-osf
;;
@@ -5128,13 +5507,13 @@ index ba33103..00f68b8 100755
+ os=-linux
+ ;;
+ parisc-*)
-+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
pbd)
basic_machine=sparc-tti
;;
-@@ -787,6 +993,12 @@ case $basic_machine in
+@@ -787,6 +990,12 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
@@ -5142,12 +5521,32 @@ index ba33103..00f68b8 100755
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
-+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
-@@ -816,11 +1028,12 @@ case $basic_machine in
+@@ -800,41 +1009,42 @@ case $basic_machine in
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
@@ -5156,23 +5555,32 @@ index ba33103..00f68b8 100755
;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ppc-* | ppcbe-*)
-+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
+ ppcle | powerpclittle)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
-@@ -830,7 +1043,7 @@ case $basic_machine in
+- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ ppc64le | powerpc64little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
-@@ -843,6 +1056,14 @@ case $basic_machine in
+- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+@@ -843,6 +1053,14 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
@@ -5187,7 +5595,7 @@ index ba33103..00f68b8 100755
rom68k)
basic_machine=m68k-rom68k
os=-coff
-@@ -869,6 +1090,10 @@ case $basic_machine in
+@@ -869,6 +1087,10 @@ case $basic_machine in
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
@@ -5198,27 +5606,35 @@ index ba33103..00f68b8 100755
sei)
basic_machine=mips-sei
os=-seiux
-@@ -880,6 +1105,9 @@ case $basic_machine in
- basic_machine=sh-hitachi
- os=-hms
+@@ -876,14 +1098,10 @@ case $basic_machine in
+ sequent)
+ basic_machine=i386-sequent
;;
+- sh)
+- basic_machine=sh-hitachi
+- os=-hms
+- ;;
+- sh64)
+- basic_machine=sh64-unknown
+ sh5el)
+ basic_machine=sh5le-unknown
-+ ;;
- sh64)
- basic_machine=sh64-unknown
;;
-@@ -901,6 +1129,9 @@ case $basic_machine in
+- sparclite-wrs | simso-wrs)
++ simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+@@ -901,6 +1119,9 @@ case $basic_machine in
basic_machine=i860-stratus
os=-sysv4
;;
+ strongarm-* | thumb-*)
-+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
sun2)
basic_machine=m68000-sun
;;
-@@ -957,17 +1188,9 @@ case $basic_machine in
+@@ -957,17 +1178,9 @@ case $basic_machine in
basic_machine=t90-cray
os=-unicos
;;
@@ -5239,17 +5655,7 @@ index ba33103..00f68b8 100755
;;
tx39)
basic_machine=mipstx39-unknown
-@@ -1021,6 +1244,9 @@ case $basic_machine in
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
-+ wasm32)
-+ basic_machine=wasm32-unknown
-+ ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
-@@ -1029,9 +1255,19 @@ case $basic_machine in
+@@ -1029,17 +1242,23 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
@@ -5264,23 +5670,20 @@ index ba33103..00f68b8 100755
basic_machine=xps100-honeywell
;;
+ xscale-* | xscalee[bl]-*)
-+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
++ basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
+ ;;
ymp)
basic_machine=ymp-cray
os=-unicos
-@@ -1040,6 +1276,10 @@ case $basic_machine in
- basic_machine=z8k-unknown
- os=-sim
;;
-+ z80-*-coff)
-+ basic_machine=z80-unknown
-+ os=-sim
-+ ;;
+- z8k-*-coff)
+- basic_machine=z8k-unknown
+- os=-sim
+- ;;
none)
basic_machine=none-none
os=-none
-@@ -1059,6 +1299,9 @@ case $basic_machine in
+@@ -1059,31 +1278,24 @@ case $basic_machine in
romp)
basic_machine=romp-ibm
;;
@@ -5290,7 +5693,16 @@ index ba33103..00f68b8 100755
rs6000)
basic_machine=rs6000-ibm
;;
-@@ -1075,13 +1318,10 @@ case $basic_machine in
+ vax)
+ basic_machine=vax-dec
+ ;;
+- pdp10)
+- # there are many clones, so DEC is not a safe bet
+- basic_machine=pdp10-unknown
+- ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
we32k)
basic_machine=we32k-att
;;
@@ -5302,11 +5714,34 @@ index ba33103..00f68b8 100755
- basic_machine=sh64-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b)
-+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
+- basic_machine=sparc-sun
+- ;;
cydra)
-@@ -1125,9 +1365,12 @@ esac
+ basic_machine=cydra-cydrome
+ ;;
+@@ -1103,7 +1315,7 @@ case $basic_machine in
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
++ echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
+ exit 1
+ ;;
+ esac
+@@ -1111,10 +1323,10 @@ esac
+ # Here we canonicalize certain aliases for manufacturers.
+ case $basic_machine in
+ *-digital*)
+- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
++ basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
++ basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+@@ -1125,49 +1337,60 @@ esac
if [ x"$os" != x"" ]
then
case $os in
@@ -5321,11 +5756,23 @@ index ba33103..00f68b8 100755
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-@@ -1143,31 +1386,37 @@ case $os in
+ -solaris)
+ os=-solaris2
+ ;;
+- -svr4*)
+- os=-sysv4
+- ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
- # First accept the basic system types.
++ # es1800 is here to avoid being matched by es* (a different OS)
++ -es1800*)
++ os=-ose
++ ;;
+ # Now accept the basic system types.
# The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
@@ -5343,7 +5790,7 @@ index ba33103..00f68b8 100755
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
-+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
++ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
@@ -5352,33 +5799,53 @@ index ba33103..00f68b8 100755
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
++ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
++ | -morphos* | -superux* | -rtmk* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-+ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
++ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
++ | -midnightbsd*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
-@@ -1185,7 +1434,7 @@ case $os in
+@@ -1184,12 +1407,12 @@ case $os in
+ -nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
-+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
++ -sim | -xray | -os68k* | -v88r* \
++ | -windows* | -osx | -abug | -netware* | -os9* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
-@@ -1206,7 +1455,7 @@ case $os in
+- os=`echo $os | sed -e 's|mac|macos|'`
++ os=`echo "$os" | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+@@ -1198,26 +1421,20 @@ case $os in
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+- os=`echo $os | sed -e 's|sunos5|solaris2|'`
++ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+- os=`echo $os | sed -e 's|sunos6|solaris3|'`
++ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
+ ;;
-opened*)
os=-openedition
;;
@@ -5387,7 +5854,18 @@ index ba33103..00f68b8 100755
os=-os400
;;
-wince*)
-@@ -1242,7 +1491,7 @@ case $os in
+ os=-wince
+ ;;
+- -osfrose*)
+- os=-osfrose
+- ;;
+- -osf*)
+- os=-osf
+- ;;
+ -utek*)
+ os=-bsd
+ ;;
+@@ -1242,7 +1459,7 @@ case $os in
-nova*)
os=-rtmk-nova
;;
@@ -5396,7 +5874,7 @@ index ba33103..00f68b8 100755
os=-nextstep2
;;
-nsk*)
-@@ -1255,7 +1504,7 @@ case $os in
+@@ -1255,7 +1472,7 @@ case $os in
-sinix*)
os=-sysv4
;;
@@ -5405,18 +5883,38 @@ index ba33103..00f68b8 100755
os=-tpf
;;
-triton*)
-@@ -1291,8 +1540,28 @@ case $os in
- -aros*)
- os=-aros
+@@ -1264,7 +1481,7 @@ case $os in
+ -oss*)
+ os=-sysv3
;;
-- -kaos*)
-- os=-kaos
+- -svr4)
++ -svr4*)
+ os=-sysv4
+ ;;
+ -svr3)
+@@ -1279,27 +1496,38 @@ case $os in
+ -ose*)
+ os=-ose
+ ;;
+- -es1800*)
+- os=-ose
+- ;;
+- -xenix)
+- os=-xenix
+- ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+- -aros*)
+- os=-aros
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
-+ ;;
+ ;;
+- -kaos*)
+- os=-kaos
+ -pikeos*)
+ # Until real need of OS specific support for
+ # particular features comes up, bare metal
@@ -5436,7 +5934,15 @@ index ba33103..00f68b8 100755
;;
-none)
;;
-@@ -1316,6 +1585,12 @@ else
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
++ echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
+ exit 1
+ ;;
+ esac
+@@ -1316,6 +1544,12 @@ else
# system, and we'll never get to this point.
case $basic_machine in
@@ -5449,7 +5955,7 @@ index ba33103..00f68b8 100755
*-acorn)
os=-riscix1.2
;;
-@@ -1325,9 +1600,24 @@ case $basic_machine in
+@@ -1325,9 +1559,24 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
@@ -5477,7 +5983,7 @@ index ba33103..00f68b8 100755
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
-@@ -1346,13 +1636,13 @@ case $basic_machine in
+@@ -1346,13 +1595,13 @@ case $basic_machine in
;;
m68000-sun)
os=-sunos3
@@ -5494,7 +6000,7 @@ index ba33103..00f68b8 100755
mips*-cisco)
os=-elf
;;
-@@ -1368,12 +1658,21 @@ case $basic_machine in
+@@ -1368,12 +1617,18 @@ case $basic_machine in
sparc-* | *-sun)
os=-sunos4.1.1
;;
@@ -5504,9 +6010,6 @@ index ba33103..00f68b8 100755
*-be)
os=-beos
;;
-+ *-haiku)
-+ os=-haiku
-+ ;;
*-ibm)
os=-aix
;;
@@ -5516,7 +6019,7 @@ index ba33103..00f68b8 100755
*-wec)
os=-proelf
;;
-@@ -1407,7 +1706,7 @@ case $basic_machine in
+@@ -1407,7 +1662,7 @@ case $basic_machine in
m88k-omron*)
os=-luna
;;
@@ -5525,7 +6028,17 @@ index ba33103..00f68b8 100755
os=-nextstep
;;
*-sequent)
-@@ -1476,7 +1775,7 @@ case $basic_machine in
+@@ -1422,9 +1677,6 @@ case $basic_machine in
+ i370-*)
+ os=-mvs
+ ;;
+- *-next)
+- os=-nextstep3
+- ;;
+ *-gould)
+ os=-sysv
+ ;;
+@@ -1476,7 +1728,7 @@ case $basic_machine in
-sunos*)
vendor=sun
;;
@@ -5534,11 +6047,18 @@ index ba33103..00f68b8 100755
vendor=ibm
;;
-beos*)
-@@ -1539,10 +1838,10 @@ case $basic_machine in
+@@ -1534,15 +1786,15 @@ case $basic_machine in
+ vendor=stratus
+ ;;
+ esac
+- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
++ basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
+ ;;
esac
- echo $basic_machine$os
+-echo $basic_machine$os
-exit 0
++echo "$basic_machine$os"
+exit
# Local variables:
@@ -5861,7 +6381,7 @@ index 8020f6d..705e277 100644
if (cookie->commentURL->length == 0)
cookie->commentURL = NULL;
diff --git a/display.c b/display.c
-index e00eb0c..f1d6f99 100644
+index e00eb0c..e62d07f 100644
--- a/display.c
+++ b/display.c
@@ -257,7 +257,7 @@ make_lastline_link(Buffer *buf, char *title, char *url)
@@ -5882,7 +6402,18 @@ index e00eb0c..f1d6f99 100644
drawImage();
}
#endif
-@@ -521,7 +521,15 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq,
+@@ -497,6 +497,10 @@ displayBuffer(Buffer *buf, int mode)
+ save_current_buf = buf;
+ }
+ #endif
++ if (mode == B_FORCE_REDRAW && (buf->check_url & CHK_URL) ) {
++ chkURLBuffer(buf);
++ displayBuffer(buf, B_NORMAL);
++ }
+ }
+
+ static void
+@@ -521,7 +525,15 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq,
break;
}
if (hseq >= 0 && an->hseq == hseq) {
@@ -5898,7 +6429,7 @@ index e00eb0c..f1d6f99 100644
if (l->propBuf[i] & (PE_IMAGE | PE_ANCHOR | PE_FORM)) {
if (active)
l->propBuf[i] |= PE_ACTIVE;
-@@ -529,9 +537,9 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq,
+@@ -529,9 +541,9 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq,
l->propBuf[i] &= ~PE_ACTIVE;
}
}
@@ -5910,7 +6441,7 @@ index e00eb0c..f1d6f99 100644
}
else if (prevhseq >= 0 && an->hseq == prevhseq) {
if (active)
-@@ -855,14 +863,16 @@ redrawLineImage(Buffer *buf, Line *l, int i)
+@@ -855,14 +867,16 @@ redrawLineImage(Buffer *buf, Line *l, int i)
y = (int)(i * pixel_per_line);
sx = (int)((rcol - COLPOS(l, a->start.pos)) * pixel_per_char);
sy = (int)((l->linenumber - image->y) * pixel_per_line);
@@ -5935,7 +6466,7 @@ index e00eb0c..f1d6f99 100644
if (image->width > 0)
w = image->width - sx;
else
-@@ -1119,18 +1129,18 @@ addChar(char c, Lineprop mode)
+@@ -1119,18 +1133,18 @@ addChar(char c, Lineprop mode)
}
#ifdef USE_M17N
if (w == 2 && WcOption.use_wide)
@@ -13847,18 +14378,80 @@ index 324ea3e..60d6d19 100644
http://w3m.sourceforge.net/
+ https://sourceforge.net/projects/w3m/
diff --git a/doc/README.cookie b/doc/README.cookie
-index 56cca50..da16947 100644
+index 56cca50..71523e0 100644
--- a/doc/README.cookie
+++ b/doc/README.cookie
+@@ -9,21 +9,21 @@ cookie support of w3m
+ http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-state-man-mec-12.txt)
+ cookie.
+
+- * If you wont to disable cookie support, run configure script with
++ * If you want to disable cookie support, run the configure script with
+ --disable-cookie option.
+
+- * You can choose to use cookie or not on the Option Setting Panel or
++ * You can choose to use cookies or not on the Option Setting Panel or
+ -cookie and -no-cookie option.
+
+- * You can disable cookie on the Option Setting Panel. In this case
+- all cookies are rejected, however, cookies which accepted before
+- disable cookie are used.
++ * You can disable cookies on the Option Setting Panel. In this case
++ all new cookies are rejected, however, cookies which were accepted before
++ cookies were disabled are used.
+
+- * You can see list of accepted cookies with C-k. In this panel, you
++ * You can see the list of accepted cookies with C-k. In this panel, you
+ can choose to use each cookie or not.
+
+- * You can specify domains accept or not accept cookies on the Option
+- Setting Panel. Domains are specified with following format.
++ * You can specify domains from which to accept or not accept cookies
++ on the Option Setting Panel. Domains are specified in the following format:
+
+ domain-list = domains
+ | ""
@@ -37,7 +37,7 @@ cookie support of w3m
(HDN: host domain name)
- ¡¦ If the number of "." in domain name is lesser than 2, it is
-+ * If the number of "." in domain name is lesser than 2, it is
++ * If the number of "." in domain name is fewer than 2, it is
assumed as invalid cookie (cf. RFC 2109 4.3.2), however, you can
use cookie_avoid_wrong_number_of_dots to avoid this
restriction. You can set this in "Domains to avoid [wrong number
+diff --git a/doc/README.dict b/doc/README.dict
+index bd82cdb..88f4b1a 100644
+--- a/doc/README.dict
++++ b/doc/README.dict
+@@ -2,14 +2,14 @@ Dictionary look-up hack for w3m
+
+ 1. INTRODUCTION
+
+-If you have dictionary look-up command (like 'webster'), you can
+-look a word in a document using w3m. This dictionary-lookup code
++If you have a dictionary look-up command (such as 'webster'), you can
++look up words in a document using w3m. This dictionary-lookup code
+ was contributed by `Rubikitch' (rubikitch@ruby-lang.org), and
+-further modifed by Tushar Samant (scribble at pobox.com).
++further modified by Tushar Samant (scribble at pobox.com).
+
+ 2. INSTALLATION
+
+-To make use of dictionary look-up, you currently must change a
++To make use of the dictionary look-up, you currently must change a
+ compile option by hand. After running configure, edit config.h
+ and change
+
+@@ -19,7 +19,7 @@ to
+
+ #define USE_DICT
+
+-and recompile w3me (i.e. type "make install").
++and recompile w3m (i.e. type "make install").
+ Note that w3m/0.3+cvs-1.373 or later, USE_DICT is defined by default.
+
+ Then find or install a CGI program which takes a word as a query
diff --git a/doc/README.func b/doc/README.func
index 0b2c034..a3ef3ac 100644
--- a/doc/README.func
@@ -14137,9 +14730,20 @@ index 0b2c034..a3ef3ac 100644
+WHEREIS Search forward
+WRAP_TOGGLE Toggle wrapping mode in searches
diff --git a/doc/README.img b/doc/README.img
-index 0c10114..f11362f 100644
+index 0c10114..af6d9db 100644
--- a/doc/README.img
+++ b/doc/README.img
+@@ -11,8 +11,8 @@ Introduction
+
+ Support
+
+- * Display inline image (GIF,PNG,JPEG, etc.) on terminals
+- (xterm,rxvt, etc.) of X11, Linux framebuffer device or
++ * Display inline images (GIF, PNG, JPEG, etc.) on terminals
++ (xterm, rxvt, etc.) of X11, Linux framebuffer device or
+ terminals of Windows.
+ * Support inline image of <img> tag.
+ Support of attributes "width", "height", and "align".
@@ -41,7 +41,7 @@ Key functions
Specify the following keymaps in ~/.w3m/keymap.
keymap X DISPLAY_IMAGE
@@ -14149,6 +14753,53 @@ index 0c10114..f11362f 100644
Commandline options
+@@ -66,7 +66,7 @@ Option panel
+ Automatic loading of inline image. The default is ON.
+ If it is OFF, loading starts with a command DISPLAY_IMAGE.
+ max_load_image
+- Maximum process for downloading of inline image. The default is 4.
++ Maximum # of processes for downloading inline images. The default is 4.
+ 1 to 8 can be set.
+ ext_image_viewer
+ Use external image viewer, when a command VIEW_IMAGE or
+@@ -75,8 +75,8 @@ Option panel
+ image_scale
+ Scale of image (%). The default value is 100(%).
+ imgdisplay
+- External command to display image". The default value is "w3mimgdisplay".
+- See "Setting w3mimgdisplay".
++ External command to display image. The default value is "w3mimgdisplay".
++ See "Setting w3mimgdisplay."
+
+ Required programs
+
+@@ -124,8 +124,8 @@ Setting w3mimgdisplay
+ The default value for Linux framebuffer device is #000000 (black).
+ When the color is specified as #RRGGBB, escape '#'.
+ -anim <n>
+- Maximum number of frames for animation. It means without limit
+- if the number is 0. Negative value count backward from the end
++ Maximum number of frames for animation. It will run everything
++ if the number is 0. Negative values count backward from the end
+ of the frames. The default value is 100.
+ -margin <n>
+ Margin of an area to clear an image. The default value is 0.
+@@ -135,13 +135,13 @@ Setting w3mimgdisplay
+
+ Notice
+ If you want to see GIF animation, please hit a suitable key, such
+- as 'h', 'l', etc., repeatedly, because a frame is rewritten
++ as 'h', 'l', etc., repeatedly, because a new frame is only requested
+ according to the re-drawing demand from w3m.
+
+ Some code in w3mimg/fb/fb.c was originally written by Mr. Yamasaki.
+ http://www.sainet.or.jp/~yamasaki/download/fb-sample.tar.gz
+
+- On Windows, we check the behaver on standard console, Cygwin rxvt
++ On Windows, we check the behavior on standard console, Cygwin rxvt
+ and PuTTY.
+
+
diff --git a/doc/README.m17n b/doc/README.m17n
index c064d76..da5408b 100644
--- a/doc/README.m17n
@@ -14162,6 +14813,57 @@ index c064d76..da5408b 100644
KOI8-R, KOI8-U, NeXT, CP437, CP737, CP775, CP850, CP852, CP855, CP856,
CP857, CP860, CP861, CP862, CP863, CP864, CP865, CP866, CP869, CP1006,
CP1250, CP1251, CP1252, CP1253, CP1254, CP1255, CP1256, CP1257
+diff --git a/doc/README.pre_form b/doc/README.pre_form
+index 972ef90..dad62f8 100644
+--- a/doc/README.pre_form
++++ b/doc/README.pre_form
+@@ -1,12 +1,12 @@
+-pre_form: Feature to configure form parameters when opening specific site.
++pre_form: Feature to pre-fill form parameters when opening a specific site.
+
+-It would be convinient for sites where you often visit, but it may introduce
+-some security issues. Be careful to use this feature, especially `submit'
++It is convenient for sites that you visit often, but it may introduce
++some security issues. Be careful when using this feature, especially `submit'
+ params described below.
+
+ Default configuration file for pre_form is ~/.w3m/pre_form.
+
+-Syntax as follows:
++The syntax of entries in the configuration file is as follows:
+
+ url <url>|/<re-url>/
+ form [<name>] <action>
+@@ -23,21 +23,21 @@ textarea <name>
+ :
+ /textarea
+
+-If <action> is set, form which has matched <action> attributes
++If <action> is set, a form which has matched <action> attributes
+ will be configured by this pre_form.
+
+-The line begining with text, file, passwd, select, textarea means that
++A line beginning with text, file, passwd, select, textarea means that
+ it will set value to <value> in input, select or textarea element which
+ name attribute matches with <name>.
+
+-The line beginning with checkbox, radio means that it will check
++A line beginning with checkbox, radio means that it will check
+ input element which name and value attribute matches with <name> and <value>
+-respectively. If <checked> is 0, no, or off, disable check of the checkbox.
++respectively. If <checked> is 0, no, or off, the checkbox will be unchecked.
+
+-The line beginning with submit or image means that it will submit input
+-element which name attribute matches with <name> (and value attribute
+-matches with <value>), or submit last <input type=submit> element if no
+-<name> specified.
++A line beginning with submit or image means that it will submit input
++element whose name attribute matches with <name> (and value attribute
++matches with <value>), or submit on the last <input type=submit> element if no
++<name> was specified.
+
+ You quote \, ' (single-quote) or " (double quote) as you do in shell.
+
diff --git a/doc/README.siteconf b/doc/README.siteconf
new file mode 100644
index 0000000..39b1028
@@ -14817,7 +15519,7 @@ index 8fe1215..37c4f15 100644
QuietMessage = TRUE;
fmInitialized = FALSE;
diff --git a/file.c b/file.c
-index 567d41e..9b0e947 100644
+index 567d41e..0333e9a 100644
--- a/file.c
+++ b/file.c
@@ -26,6 +26,8 @@
@@ -14928,7 +15630,20 @@ index 567d41e..9b0e947 100644
int
matchattr(char *p, char *attr, int len, Str *value)
{
-@@ -694,6 +679,7 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
+@@ -626,8 +611,10 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
+ if(w3m_reqlog){
+ FILE *ff;
+ ff = fopen(w3m_reqlog, "a");
+- Strfputs(tmp, ff);
+- fclose(ff);
++ if(ff){
++ Strfputs(tmp, ff);
++ fclose(ff);
++ }
+ }
+ if (src)
+ Strfputs(tmp, src);
+@@ -694,6 +681,7 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
#endif
init_stream(&f, SCM_LOCAL, newStrStream(src));
loadHTMLstream(&f, newBuf, NULL, TRUE);
@@ -14936,7 +15651,7 @@ index 567d41e..9b0e947 100644
for (l = newBuf->lastLine; l && l->real_linenumber;
l = l->prev)
l->real_linenumber = 0;
-@@ -1244,6 +1230,7 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
+@@ -1244,6 +1232,7 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
unsigned char md5[MD5_DIGEST_LENGTH + 1];
Str uri = HTTPrequestURI(pu, hr);
char nc[] = "00000001";
@@ -14944,7 +15659,7 @@ index 567d41e..9b0e947 100644
Str algorithm = qstr_unquote(get_auth_param(ha->param, "algorithm"));
Str nonce = qstr_unquote(get_auth_param(ha->param, "nonce"));
-@@ -1326,10 +1313,11 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
+@@ -1326,10 +1315,11 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
/* A2 = Method ":" digest-uri-value ":" H(entity-body) */
if (request && request->body) {
if (request->method == FORM_METHOD_POST && request->enctype == FORM_ENCTYPE_MULTIPART) {
@@ -14957,7 +15672,7 @@ index 567d41e..9b0e947 100644
MD5(ebody->ptr, strlen(ebody->ptr), md5);
}
else {
-@@ -1697,13 +1685,15 @@ getLinkNumberStr(int correction)
+@@ -1697,13 +1687,15 @@ getLinkNumberStr(int correction)
/*
* loadGeneralFile: load file to buffer
*/
@@ -14974,7 +15689,7 @@ index 567d41e..9b0e947 100644
char *volatile tpath;
char *volatile t = "text/plain", *p, *volatile real_type = NULL;
Buffer *volatile t_buf = NULL;
-@@ -1730,7 +1720,22 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
+@@ -1730,7 +1722,22 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
add_auth_cookie_flag = 0;
checkRedirection(NULL);
@@ -14997,7 +15712,7 @@ index 567d41e..9b0e947 100644
TRAP_OFF;
url_option.referer = referer;
url_option.flag = flag;
-@@ -1863,7 +1868,7 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
+@@ -1863,7 +1870,7 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
/* 302: Found */
/* 303: See Other */
/* 307: Temporary Redirect (HTTP/1.1) */
@@ -15006,7 +15721,7 @@ index 567d41e..9b0e947 100644
request = NULL;
UFclose(&f);
current = New(ParsedURL);
-@@ -2022,7 +2027,7 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
+@@ -2022,7 +2029,7 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
if (f.is_cgi && (p = checkHeader(t_buf, "Location:")) != NULL &&
checkRedirection(&pu)) {
/* document moved */
@@ -15015,7 +15730,7 @@ index 567d41e..9b0e947 100644
request = NULL;
UFclose(&f);
add_auth_cookie_flag = 0;
-@@ -2123,10 +2128,6 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
+@@ -2123,10 +2130,6 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
if (real_type == NULL)
real_type = t;
proc = loadBuffer;
@@ -15026,7 +15741,7 @@ index 567d41e..9b0e947 100644
current_content_length = 0;
if ((p = checkHeader(t_buf, "Content-Length:")) != NULL)
-@@ -2197,18 +2198,8 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
+@@ -2197,18 +2200,8 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
#endif
else if (w3m_backend) ;
else if (!(w3m_dump & ~DUMP_FRAME) || is_dump_text_type(t)) {
@@ -15047,7 +15762,7 @@ index 567d41e..9b0e947 100644
}
else {
TRAP_OFF;
-@@ -2232,36 +2223,30 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
+@@ -2232,36 +2225,30 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
else if (w3m_dump & DUMP_FRAME)
return NULL;
@@ -15098,7 +15813,7 @@ index 567d41e..9b0e947 100644
if (pu.label) {
if (proc == loadHTMLBuffer) {
Anchor *a;
-@@ -2287,10 +2272,11 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
+@@ -2287,10 +2274,11 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
if (header_string)
header_string = NULL;
#ifdef USE_NNTP
@@ -15112,7 +15827,7 @@ index 567d41e..9b0e947 100644
TRAP_OFF;
return b;
}
-@@ -2325,8 +2311,12 @@ push_link(int cmd, int offset, int pos)
+@@ -2325,8 +2313,12 @@ push_link(int cmd, int offset, int pos)
struct link_stack *p;
p = New(struct link_stack);
p->cmd = cmd;
@@ -15127,7 +15842,7 @@ index 567d41e..9b0e947 100644
p->next = link_stack;
link_stack = p;
}
-@@ -2469,6 +2459,7 @@ set_breakpoint(struct readbuffer *obuf, int tag_length)
+@@ -2469,6 +2461,7 @@ set_breakpoint(struct readbuffer *obuf, int tag_length)
bcopy((void *)&obuf->anchor, (void *)&obuf->bp.anchor,
sizeof(obuf->anchor));
obuf->bp.img_alt = obuf->img_alt;
@@ -15135,7 +15850,7 @@ index 567d41e..9b0e947 100644
obuf->bp.in_bold = obuf->in_bold;
obuf->bp.in_italic = obuf->in_italic;
obuf->bp.in_under = obuf->in_under;
-@@ -2486,6 +2477,7 @@ back_to_breakpoint(struct readbuffer *obuf)
+@@ -2486,6 +2479,7 @@ back_to_breakpoint(struct readbuffer *obuf)
bcopy((void *)&obuf->bp.anchor, (void *)&obuf->anchor,
sizeof(obuf->anchor));
obuf->img_alt = obuf->bp.img_alt;
@@ -15143,7 +15858,7 @@ index 567d41e..9b0e947 100644
obuf->in_bold = obuf->bp.in_bold;
obuf->in_italic = obuf->bp.in_italic;
obuf->in_under = obuf->bp.in_under;
-@@ -2729,7 +2721,7 @@ flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent,
+@@ -2729,7 +2723,7 @@ flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent,
Str line = obuf->line, pass = NULL;
char *hidden_anchor = NULL, *hidden_img = NULL, *hidden_bold = NULL,
*hidden_under = NULL, *hidden_italic = NULL, *hidden_strike = NULL,
@@ -15152,7 +15867,7 @@ index 567d41e..9b0e947 100644
#ifdef DEBUG
if (w3m_debug) {
-@@ -2761,6 +2753,12 @@ flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent,
+@@ -2761,6 +2755,12 @@ flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent,
hidden = hidden_img;
}
}
@@ -15165,7 +15880,7 @@ index 567d41e..9b0e947 100644
if (obuf->in_bold) {
if ((hidden_bold = has_hidden_link(obuf, HTML_B)) != NULL) {
if (!hidden || hidden_bold < hidden)
-@@ -2812,6 +2810,8 @@ flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent,
+@@ -2812,6 +2812,8 @@ flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent,
Strcat_charp(line, "</a>");
if (obuf->img_alt && !hidden_img)
Strcat_charp(line, "</img_alt>");
@@ -15174,7 +15889,7 @@ index 567d41e..9b0e947 100644
if (obuf->in_bold && !hidden_bold)
Strcat_charp(line, "</b>");
if (obuf->in_italic && !hidden_italic)
-@@ -3022,6 +3022,18 @@ flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent,
+@@ -3022,6 +3024,18 @@ flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent,
Strcat_charp(tmp, "\">");
push_tag(obuf, tmp->ptr, HTML_IMG_ALT);
}
@@ -15193,7 +15908,7 @@ index 567d41e..9b0e947 100644
if (!hidden_bold && obuf->in_bold)
push_tag(obuf, "<B>", HTML_B);
if (!hidden_italic && obuf->in_italic)
-@@ -3228,7 +3240,7 @@ process_img(struct parsed_tag *tag, int width)
+@@ -3228,7 +3242,7 @@ process_img(struct parsed_tag *tag, int width)
if (!parsedtag_get_value(tag, ATTR_SRC, &p))
return tmp;
@@ -15202,7 +15917,7 @@ index 567d41e..9b0e947 100644
q = NULL;
parsedtag_get_value(tag, ATTR_ALT, &q);
if (!pseudoInlines && (q == NULL || (*q == '\0' && ignore_null_img_alt)))
-@@ -3255,9 +3267,9 @@ process_img(struct parsed_tag *tag, int width)
+@@ -3255,9 +3269,9 @@ process_img(struct parsed_tag *tag, int width)
}
#endif
}
@@ -15213,7 +15928,7 @@ index 567d41e..9b0e947 100644
if (parsedtag_get_value(tag, ATTR_HEIGHT, &i)) {
if (i > 0) {
i = (int)(i * image_scale / 100 + 0.5);
-@@ -3322,12 +3334,7 @@ process_img(struct parsed_tag *tag, int width)
+@@ -3322,12 +3336,7 @@ process_img(struct parsed_tag *tag, int width)
Image image;
ParsedURL u;
@@ -15226,7 +15941,7 @@ index 567d41e..9b0e947 100644
image.url = parsedURL2Str(&u)->ptr;
if (!uncompressed_file_type(u.file, &image.ext))
image.ext = filename_extension(u.file, TRUE);
-@@ -3346,8 +3353,14 @@ process_img(struct parsed_tag *tag, int width)
+@@ -3346,8 +3355,14 @@ process_img(struct parsed_tag *tag, int width)
if (i < 0)
i = pixel_per_line;
}
@@ -15243,7 +15958,7 @@ index 567d41e..9b0e947 100644
Strcat(tmp,
Sprintf("<pre_int><img_alt hseq=\"%d\" src=\"", cur_iseq++));
pre_int = TRUE;
-@@ -3378,19 +3391,21 @@ process_img(struct parsed_tag *tag, int width)
+@@ -3378,19 +3393,21 @@ process_img(struct parsed_tag *tag, int width)
if (i0 >= 0)
Strcat(tmp, Sprintf(" height=%d", i0));
switch (align) {
@@ -15273,7 +15988,7 @@ index 567d41e..9b0e947 100644
case ALIGN_BOTTOM:
top = ni - 1;
bottom = 0;
-@@ -3408,7 +3423,12 @@ process_img(struct parsed_tag *tag, int width)
+@@ -3408,7 +3425,12 @@ process_img(struct parsed_tag *tag, int width)
}
break;
}
@@ -15287,7 +16002,7 @@ index 567d41e..9b0e947 100644
if (xoffset)
Strcat(tmp, Sprintf(" xoffset=%d", xoffset));
if (yoffset)
-@@ -3435,7 +3455,7 @@ process_img(struct parsed_tag *tag, int width)
+@@ -3435,7 +3457,7 @@ process_img(struct parsed_tag *tag, int width)
if (use_image) {
if (n > nw) {
char *r;
@@ -15296,7 +16011,7 @@ index 567d41e..9b0e947 100644
if (n + get_mcwidth(r) > nw)
break;
}
-@@ -3548,7 +3568,7 @@ process_anchor(struct parsed_tag *tag, char *tagbuf)
+@@ -3548,7 +3570,7 @@ process_anchor(struct parsed_tag *tag, char *tagbuf)
Str
process_input(struct parsed_tag *tag)
{
@@ -15305,7 +16020,7 @@ index 567d41e..9b0e947 100644
char *q, *p, *r, *p2, *s;
Str tmp = NULL;
char *qq = "";
-@@ -3567,9 +3587,9 @@ process_input(struct parsed_tag *tag)
+@@ -3567,9 +3589,9 @@ process_input(struct parsed_tag *tag)
parsedtag_get_value(tag, ATTR_VALUE, &q);
r = "";
parsedtag_get_value(tag, ATTR_NAME, &r);
@@ -15318,7 +16033,7 @@ index 567d41e..9b0e947 100644
parsedtag_get_value(tag, ATTR_MAXLENGTH, &i);
p2 = NULL;
parsedtag_get_value(tag, ATTR_ALT, &p2);
-@@ -3623,9 +3643,10 @@ process_input(struct parsed_tag *tag)
+@@ -3623,9 +3645,10 @@ process_input(struct parsed_tag *tag)
Strcat(tmp, getLinkNumberStr(0));
Strcat_char(tmp, '(');
}
@@ -15331,7 +16046,7 @@ index 567d41e..9b0e947 100644
if (x)
Strcat_charp(tmp, " checked");
if (y)
-@@ -3670,18 +3691,18 @@ process_input(struct parsed_tag *tag)
+@@ -3670,18 +3693,18 @@ process_input(struct parsed_tag *tag)
case FORM_INPUT_PASSWORD:
i = 0;
if (q) {
@@ -15354,7 +16069,7 @@ index 567d41e..9b0e947 100644
Strcat_char(tmp, ' ');
}
break;
-@@ -3731,6 +3752,75 @@ process_input(struct parsed_tag *tag)
+@@ -3731,6 +3754,75 @@ process_input(struct parsed_tag *tag)
return tmp;
}
@@ -15430,7 +16145,7 @@ index 567d41e..9b0e947 100644
Str
process_select(struct parsed_tag *tag)
{
-@@ -3926,7 +4016,7 @@ process_textarea(struct parsed_tag *tag, int width)
+@@ -3926,7 +4018,7 @@ process_textarea(struct parsed_tag *tag, int width)
cur_textarea_size = 20;
if (parsedtag_get_value(tag, ATTR_COLS, &p)) {
cur_textarea_size = atoi(p);
@@ -15439,7 +16154,7 @@ index 567d41e..9b0e947 100644
cur_textarea_size = width * cur_textarea_size / 100 - 2;
if (cur_textarea_size <= 0) {
cur_textarea_size = 20;
-@@ -4003,7 +4093,9 @@ feed_textarea(char *str)
+@@ -4003,7 +4095,9 @@ feed_textarea(char *str)
Strcat_charp(textarea_str[n_textarea], "\r\n");
str++;
}
@@ -15450,7 +16165,7 @@ index 567d41e..9b0e947 100644
Strcat_char(textarea_str[n_textarea], *(str++));
}
}
-@@ -4084,6 +4176,7 @@ process_form_int(struct parsed_tag *tag, int fid)
+@@ -4084,6 +4178,7 @@ process_form_int(struct parsed_tag *tag, int fid)
parsedtag_get_value(tag, ATTR_METHOD, &p);
q = "!CURRENT_URL!";
parsedtag_get_value(tag, ATTR_ACTION, &q);
@@ -15458,7 +16173,7 @@ index 567d41e..9b0e947 100644
r = NULL;
#ifdef USE_M17N
if (parsedtag_get_value(tag, ATTR_ACCEPT_CHARSET, &r))
-@@ -4113,7 +4206,7 @@ process_form_int(struct parsed_tag *tag, int fid)
+@@ -4113,7 +4208,7 @@ process_form_int(struct parsed_tag *tag, int fid)
forms = New_N(FormList *, forms_size);
form_stack = NewAtom_N(int, forms_size);
}
@@ -15467,7 +16182,7 @@ index 567d41e..9b0e947 100644
forms_size += form_max;
forms = New_Reuse(FormList *, forms, forms_size);
form_stack = New_Reuse(int, form_stack, forms_size);
-@@ -4284,15 +4377,16 @@ getMetaRefreshParam(char *q, Str *refresh_uri)
+@@ -4284,15 +4379,16 @@ getMetaRefreshParam(char *q, Str *refresh_uri)
while (*q) {
if (!strncasecmp(q, "url=", 4)) {
q += 4;
@@ -15487,7 +16202,7 @@ index 567d41e..9b0e947 100644
s_tmp->length--;
s_tmp->ptr[s_tmp->length] = '\0';
}
-@@ -4599,6 +4693,12 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
+@@ -4599,6 +4695,12 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
case HTML_DD:
CLOSE_A;
CLOSE_DT;
@@ -15500,7 +16215,7 @@ index 567d41e..9b0e947 100644
if (envs[h_env->envc].env == HTML_DL_COMPACT) {
if (obuf->pos > envs[h_env->envc].indent)
flushline(h_env, obuf, envs[h_env->envc].indent, 0,
-@@ -4833,13 +4933,13 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
+@@ -4833,13 +4935,13 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
#ifdef USE_IMAGE
i = 0;
if (parsedtag_get_value(tag, ATTR_TOP_MARGIN, &i)) {
@@ -15518,7 +16233,7 @@ index 567d41e..9b0e947 100644
}
#endif
return 0;
-@@ -4853,15 +4953,43 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
+@@ -4853,15 +4955,43 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
case HTML_INPUT_ALT:
i = 0;
if (parsedtag_get_value(tag, ATTR_TOP_MARGIN, &i)) {
@@ -15566,7 +16281,7 @@ index 567d41e..9b0e947 100644
case HTML_TABLE:
close_anchor(h_env, obuf);
obuf->table_level++;
-@@ -4884,6 +5012,8 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
+@@ -4884,6 +5014,8 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
else
w = BORDER_THIN;
}
@@ -15575,7 +16290,7 @@ index 567d41e..9b0e947 100644
if (parsedtag_get_value(tag, ATTR_WIDTH, &i)) {
if (obuf->table_level == 0)
width = REAL_WIDTH(i, h_env->limit - envs[h_env->envc].indent);
-@@ -4892,9 +5022,24 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
+@@ -4892,9 +5024,24 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
}
if (parsedtag_exists(tag, ATTR_HBORDER))
w = BORDER_NOWIN;
@@ -15600,7 +16315,7 @@ index 567d41e..9b0e947 100644
#ifdef ID_EXT
parsedtag_get_value(tag, ATTR_ID, &id);
#endif /* ID_EXT */
-@@ -4970,6 +5115,16 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
+@@ -4970,6 +5117,16 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
case HTML_INPUT:
close_anchor(h_env, obuf);
tmp = process_input(tag);
@@ -15617,7 +16332,7 @@ index 567d41e..9b0e947 100644
if (tmp)
HTMLlineproc1(tmp->ptr, h_env);
return 1;
-@@ -5067,11 +5222,10 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
+@@ -5067,11 +5224,10 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
}
return 1;
case HTML_BASE:
@@ -15631,7 +16346,7 @@ index 567d41e..9b0e947 100644
parseURL(p, cur_baseURL, NULL);
}
#endif
-@@ -5329,6 +5483,13 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5329,6 +5485,13 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
#ifdef MENU_SELECT
Anchor **a_select = NULL;
#endif
@@ -15645,7 +16360,7 @@ index 567d41e..9b0e947 100644
if (out_size == 0) {
out_size = LINELEN;
-@@ -5523,16 +5684,17 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5523,16 +5686,17 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
hseq = 0;
id = NULL;
if (parsedtag_get_value(tag, ATTR_NAME, &id)) {
@@ -15667,7 +16382,7 @@ index 567d41e..9b0e947 100644
parsedtag_get_value(tag, ATTR_TITLE, &s);
parsedtag_get_value(tag, ATTR_ACCESSKEY, &t);
parsedtag_get_value(tag, ATTR_HSEQ, &hseq);
-@@ -5571,7 +5733,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5571,7 +5735,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
a_href->end.pos = pos;
if (a_href->start.line == a_href->end.line &&
a_href->start.pos == a_href->end.pos) {
@@ -15676,7 +16391,7 @@ index 567d41e..9b0e947 100644
a_href->hseq < buf->hmarklist->nmark)
buf->hmarklist->marks[a_href->hseq].invalid = 1;
a_href->hseq = -1;
-@@ -5618,7 +5780,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5618,7 +5782,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
ParsedURL u;
Image *image;
@@ -15685,7 +16400,7 @@ index 567d41e..9b0e947 100644
a_img->image = image = New(Image);
image->url = parsedURL2Str(&u)->ptr;
if (!uncompressed_file_type(u.file, &image->ext))
-@@ -5639,7 +5801,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5639,7 +5803,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
image->map = q;
image->ismap = ismap;
image->touch = 0;
@@ -15694,7 +16409,7 @@ index 567d41e..9b0e947 100644
IMG_FLAG_SKIP);
}
else if (iseq < 0) {
-@@ -5678,7 +5840,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5678,7 +5842,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
parsedtag_get_value(tag, ATTR_FID, &form_id);
parsedtag_get_value(tag, ATTR_TOP_MARGIN, &top);
parsedtag_get_value(tag, ATTR_BOTTOM_MARGIN, &bottom);
@@ -15704,7 +16419,7 @@ index 567d41e..9b0e947 100644
break; /* outside of <form>..</form> */
form = forms[form_id];
if (hseq > 0) {
-@@ -5689,6 +5852,21 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5689,6 +5854,21 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
putHmarker(buf->hmarklist, currentLn(buf),
hpos, hseq - 1);
}
@@ -15726,7 +16441,7 @@ index 567d41e..9b0e947 100644
if (!form->target)
form->target = buf->baseTarget;
if (a_textarea &&
-@@ -5761,8 +5939,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5761,8 +5941,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
break;
if (parsedtag_get_value(tag, ATTR_HREF, &p)) {
MapArea *a;
@@ -15737,7 +16452,7 @@ index 567d41e..9b0e947 100644
t = NULL;
parsedtag_get_value(tag, ATTR_TARGET, &t);
q = "";
-@@ -5811,11 +5989,14 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5811,11 +5991,14 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
break;
case HTML_BASE:
if (parsedtag_get_value(tag, ATTR_HREF, &p)) {
@@ -15755,7 +16470,7 @@ index 567d41e..9b0e947 100644
}
if (parsedtag_get_value(tag, ATTR_TARGET, &p))
buf->baseTarget =
-@@ -5830,8 +6011,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5830,8 +6013,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
int refresh_interval = getMetaRefreshParam(q, &tmp);
#ifdef USE_ALARM
if (tmp) {
@@ -15766,7 +16481,7 @@ index 567d41e..9b0e947 100644
buf->event = setAlarmEvent(buf->event,
refresh_interval,
AL_IMPLICIT_ONCE,
-@@ -5844,8 +6025,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5844,8 +6027,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
FUNCNAME_reload, NULL);
#else
if (tmp && refresh_interval == 0) {
@@ -15777,7 +16492,7 @@ index 567d41e..9b0e947 100644
pushEvent(FUNCNAME_gorURL, p);
}
#endif
-@@ -5864,14 +6045,14 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5864,14 +6047,14 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
case HTML_TEXTAREA_INT:
if (parsedtag_get_value(tag, ATTR_TEXTAREANUMBER,
&n_textarea)
@@ -15794,7 +16509,7 @@ index 567d41e..9b0e947 100644
FormItemList *item =
(FormItemList *)a_textarea[n_textarea]->url;
item->init_value = item->value =
-@@ -5881,7 +6062,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5881,7 +6064,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
#ifdef MENU_SELECT
case HTML_SELECT_INT:
if (parsedtag_get_value(tag, ATTR_SELECTNUMBER, &n_select)
@@ -15803,7 +16518,7 @@ index 567d41e..9b0e947 100644
select_option[n_select].first = NULL;
select_option[n_select].last = NULL;
}
-@@ -5889,7 +6070,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5889,7 +6072,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
n_select = -1;
break;
case HTML_N_SELECT_INT:
@@ -15812,7 +16527,7 @@ index 567d41e..9b0e947 100644
FormItemList *item =
(FormItemList *)a_select[n_select]->url;
item->select_option = select_option[n_select].first;
-@@ -5929,7 +6110,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5929,7 +6112,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
#ifdef ID_EXT
id = NULL;
if (parsedtag_get_value(tag, ATTR_ID, &id)) {
@@ -15821,7 +16536,7 @@ index 567d41e..9b0e947 100644
registerName(buf, id, currentLn(buf), pos);
}
if (renderFrameSet &&
-@@ -5964,7 +6145,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
+@@ -5964,7 +6147,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
fclose(debug);
#endif
for (form_id = 1; form_id <= form_max; form_id++)
@@ -15831,7 +16546,7 @@ index 567d41e..9b0e947 100644
buf->formlist = (form_max >= 0) ? forms[form_max] : NULL;
if (n_textarea)
addMultirowsForm(buf, buf->formitem);
-@@ -5982,7 +6164,8 @@ addLink(Buffer *buf, struct parsed_tag *tag)
+@@ -5982,7 +6166,8 @@ addLink(Buffer *buf, struct parsed_tag *tag)
parsedtag_get_value(tag, ATTR_HREF, &href);
if (href)
@@ -15841,7 +16556,7 @@ index 567d41e..9b0e947 100644
parsedtag_get_value(tag, ATTR_TITLE, &title);
parsedtag_get_value(tag, ATTR_TYPE, &ctype);
parsedtag_get_value(tag, ATTR_REL, &rel);
-@@ -6154,10 +6337,10 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
+@@ -6154,10 +6339,10 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
while (*line != '\0') {
char *str, *p;
int is_tag = FALSE;
@@ -15856,7 +16571,7 @@ index 567d41e..9b0e947 100644
if (*line == '<' || obuf->status != R_ST_NORMAL) {
/*
-@@ -6173,7 +6356,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
+@@ -6173,7 +6358,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
}
if (h_env->tagbuf->length == 0)
continue;
@@ -15865,7 +16580,7 @@ index 567d41e..9b0e947 100644
if (*str == '<') {
if (str[1] && REALLY_THE_BEGINNING_OF_A_TAG(str))
is_tag = TRUE;
-@@ -6239,7 +6422,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
+@@ -6239,7 +6424,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
}
proc_normal:
@@ -15874,7 +16589,7 @@ index 567d41e..9b0e947 100644
/*
* within table: in <table>..</table>, all input tokens
* are fed to the table renderer, and then the renderer
-@@ -6255,6 +6438,8 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
+@@ -6255,6 +6440,8 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
if (obuf->table_level >= 0) {
struct table *tbl0 = tables[obuf->table_level];
str = Sprintf("<table_alt tid=%d>", tbl0->ntable)->ptr;
@@ -15883,7 +16598,7 @@ index 567d41e..9b0e947 100644
pushTable(tbl0, tbl);
tbl = tbl0;
tbl_mode = &table_mode[obuf->table_level];
-@@ -6272,6 +6457,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
+@@ -6272,6 +6459,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
do_blankline(h_env, obuf, indent, 0, h_env->limit);
}
save_fonteffect(h_env, obuf);
@@ -15891,7 +16606,7 @@ index 567d41e..9b0e947 100644
renderTable(tbl, tbl_width, h_env);
restore_fonteffect(h_env, obuf);
obuf->flag &= ~RB_IGNORE_P;
-@@ -6429,7 +6615,8 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
+@@ -6429,7 +6617,8 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
indent = h_env->envs[h_env->envc].indent;
if (obuf->bp.pos - i > indent) {
Str line;
@@ -15901,7 +16616,7 @@ index 567d41e..9b0e947 100644
line = Strnew_charp(bp);
Strshrink(obuf->line, obuf->line->length - obuf->bp.len);
#ifdef FORMAT_NICE
-@@ -6756,6 +6943,12 @@ init_henv(struct html_feed_environ *h_env, struct readbuffer *obuf,
+@@ -6756,6 +6945,12 @@ init_henv(struct html_feed_environ *h_env, struct readbuffer *obuf,
obuf->nobr_level = 0;
bzero((void *)&obuf->anchor, sizeof(obuf->anchor));
obuf->img_alt = 0;
@@ -15914,7 +16629,7 @@ index 567d41e..9b0e947 100644
obuf->in_bold = 0;
obuf->in_italic = 0;
obuf->in_under = 0;
-@@ -6791,6 +6984,15 @@ completeHTMLstream(struct html_feed_environ *h_env, struct readbuffer *obuf)
+@@ -6791,6 +6986,15 @@ completeHTMLstream(struct html_feed_environ *h_env, struct readbuffer *obuf)
push_tag(obuf, "</img_alt>", HTML_N_IMG_ALT);
obuf->img_alt = NULL;
}
@@ -15930,7 +16645,7 @@ index 567d41e..9b0e947 100644
if (obuf->in_bold) {
push_tag(obuf, "</b>", HTML_N_B);
obuf->in_bold = 0;
-@@ -6824,9 +7026,12 @@ completeHTMLstream(struct html_feed_environ *h_env, struct readbuffer *obuf)
+@@ -6824,9 +7028,12 @@ completeHTMLstream(struct html_feed_environ *h_env, struct readbuffer *obuf)
obuf->table_level = MAX_TABLE - 1;
while (obuf->table_level >= 0) {
@@ -15943,7 +16658,7 @@ index 567d41e..9b0e947 100644
}
}
-@@ -6848,6 +7053,8 @@ print_internal_information(struct html_feed_environ *henv)
+@@ -6848,6 +7055,8 @@ print_internal_information(struct html_feed_environ *henv)
if (form_max >= 0) {
FormList *fp;
for (i = 0; i <= form_max; i++) {
@@ -15952,7 +16667,7 @@ index 567d41e..9b0e947 100644
fp = forms[i];
s = Sprintf("<form_int fid=\"%d\" action=\"%s\" method=\"%s\"",
i, html_quote(fp->action->ptr),
-@@ -6963,8 +7170,6 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)
+@@ -6963,8 +7172,6 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)
image_flag = IMG_FLAG_AUTO;
else
image_flag = IMG_FLAG_SKIP;
@@ -15961,7 +16676,7 @@ index 567d41e..9b0e947 100644
#endif
if (w3m_halfload) {
-@@ -6987,6 +7192,9 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)
+@@ -6987,6 +7194,9 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)
htmlenv1.f = stdout;
else
htmlenv1.buf = newTextLineList();
@@ -15971,7 +16686,7 @@ index 567d41e..9b0e947 100644
if (SETJMP(AbortLoading) != 0) {
HTMLlineproc1("<br>Transfer Interrupted!<br>", &htmlenv1);
-@@ -7048,18 +7256,23 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)
+@@ -7048,18 +7258,23 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)
}
#endif
lineBuf2 = convertLine(f, lineBuf2, HTML_MODE, &charset, doc_charset);
@@ -15997,7 +16712,7 @@ index 567d41e..9b0e947 100644
if (htmlenv1.title)
newBuf->buffername = htmlenv1.title;
if (w3m_halfdump) {
-@@ -7096,16 +7309,17 @@ loadHTMLString(Str page)
+@@ -7096,16 +7311,17 @@ loadHTMLString(Str page)
MySignalHandler(*volatile prevtrap) (SIGNAL_ARG) = NULL;
Buffer *newBuf;
@@ -16017,7 +16732,7 @@ index 567d41e..9b0e947 100644
#ifdef USE_M17N
newBuf->document_charset = InnerCharset;
#endif
-@@ -7115,6 +7329,7 @@ loadHTMLString(Str page)
+@@ -7115,6 +7331,7 @@ loadHTMLString(Str page)
#endif
TRAP_OFF;
@@ -16025,7 +16740,7 @@ index 567d41e..9b0e947 100644
newBuf->topLine = newBuf->firstLine;
newBuf->lastLine = newBuf->currentLine;
newBuf->currentLine = newBuf->firstLine;
-@@ -7207,7 +7422,7 @@ loadGopherDir(URLFile *uf, ParsedURL *pu, wc_ces * charset)
+@@ -7207,7 +7424,7 @@ loadGopherDir(URLFile *uf, ParsedURL *pu, wc_ces * charset)
q = Strnew_m_charp("gopher://", host->ptr, ":", port->ptr,
"/", file->ptr, NULL)->ptr;
Strcat_m_charp(tmp, "<a href=\"",
@@ -16034,7 +16749,7 @@ index 567d41e..9b0e947 100644
"\">", p, html_quote(name->ptr + 1), "</a>\n", NULL);
}
-@@ -7243,7 +7458,6 @@ loadBuffer(URLFile *uf, Buffer *volatile newBuf)
+@@ -7243,7 +7460,6 @@ loadBuffer(URLFile *uf, Buffer *volatile newBuf)
if (newBuf == NULL)
newBuf = newBuffer(INIT_BUFFER_WIDTH);
@@ -16042,7 +16757,7 @@ index 567d41e..9b0e947 100644
if (SETJMP(AbortLoading) != 0) {
goto _end;
-@@ -7331,6 +7545,7 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
+@@ -7331,6 +7547,7 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
URLFile f;
MySignalHandler(*volatile prevtrap) (SIGNAL_ARG) = NULL;
struct stat st;
@@ -16050,7 +16765,7 @@ index 567d41e..9b0e947 100644
loadImage(newBuf, IMG_FLAG_STOP);
image.url = uf->url;
-@@ -7338,20 +7553,18 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
+@@ -7338,20 +7555,18 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
image.width = -1;
image.height = -1;
image.cache = NULL;
@@ -16074,7 +16789,13 @@ index 567d41e..9b0e947 100644
TRAP_OFF;
cache->loaded = IMG_FLAG_LOADED;
-@@ -7371,6 +7584,7 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
+@@ -7367,10 +7582,13 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
+ tmp = Sprintf("<img src=\"%s\"><br><br>", html_quote(image.url));
+ tmpf = tmpfname(TMPF_SRC, ".html");
+ src = fopen(tmpf->ptr, "w");
++ if (src == NULL)
++ return NULL;
+ newBuf->mailcap_source = tmpf->ptr;
init_stream(&f, SCM_LOCAL, newStrStream(tmp));
loadHTMLstream(&f, newBuf, src, TRUE);
@@ -16082,7 +16803,7 @@ index 567d41e..9b0e947 100644
if (src)
fclose(src);
-@@ -7411,7 +7625,7 @@ conv_symbol(Line *l)
+@@ -7411,7 +7629,7 @@ conv_symbol(Line *l)
symbol = get_symbol(DisplayCharset, &w);
#endif
}
@@ -16091,7 +16812,7 @@ index 567d41e..9b0e947 100644
#ifdef USE_M17N
p += len - 1;
pr += len - 1;
-@@ -7580,8 +7794,11 @@ openGeneralPagerBuffer(InputStream stream)
+@@ -7580,8 +7798,11 @@ openGeneralPagerBuffer(InputStream stream)
#ifdef USE_M17N
content_charset = 0;
#endif
@@ -16104,7 +16825,7 @@ index 567d41e..9b0e947 100644
readHeader(&uf, t_buf, TRUE, NULL);
t = checkContentType(t_buf);
if (t == NULL)
-@@ -7609,14 +7826,13 @@ openGeneralPagerBuffer(InputStream stream)
+@@ -7609,14 +7830,13 @@ openGeneralPagerBuffer(InputStream stream)
#ifdef USE_IMAGE
else if (activeImage && displayImage && !useExtImageViewer &&
!(w3m_dump & ~DUMP_FRAME) && !strncasecmp(t, "image/", 6)) {
@@ -16121,7 +16842,7 @@ index 567d41e..9b0e947 100644
UFclose(&uf);
if (buf == NULL || buf == NO_BUFFER)
return buf;
-@@ -7629,8 +7845,6 @@ openGeneralPagerBuffer(InputStream stream)
+@@ -7629,8 +7849,6 @@ openGeneralPagerBuffer(InputStream stream)
}
}
buf->real_type = t;
@@ -16130,7 +16851,7 @@ index 567d41e..9b0e947 100644
return buf;
}
-@@ -7766,6 +7980,8 @@ save2tmp(URLFile uf, char *tmpf)
+@@ -7766,6 +7984,8 @@ save2tmp(URLFile uf, char *tmpf)
clen_t linelen = 0, trbyte = 0;
MySignalHandler(*volatile prevtrap) (SIGNAL_ARG) = NULL;
static JMP_BUF env_bak;
@@ -16139,7 +16860,7 @@ index 567d41e..9b0e947 100644
ff = fopen(tmpf, "wb");
if (ff == NULL) {
-@@ -7802,30 +8018,29 @@ save2tmp(URLFile uf, char *tmpf)
+@@ -7802,30 +8022,29 @@ save2tmp(URLFile uf, char *tmpf)
else
#endif /* USE_NNTP */
{
@@ -16182,7 +16903,7 @@ index 567d41e..9b0e947 100644
{
Str tmpf, command;
struct mailcap *mcap;
-@@ -7834,7 +8049,7 @@ doExternal(URLFile uf, char *path, char *type, Buffer **bufp,
+@@ -7834,7 +8053,7 @@ doExternal(URLFile uf, char *path, char *type, Buffer **bufp,
char *header, *src = NULL, *ext = uf.ext;
if (!(mcap = searchExtViewer(type)))
@@ -16191,7 +16912,7 @@ index 567d41e..9b0e947 100644
if (mcap->nametemplate) {
tmpf = unquote_mailcap(mcap->nametemplate, NULL, "", NULL, NULL);
-@@ -7867,15 +8082,13 @@ doExternal(URLFile uf, char *path, char *type, Buffer **bufp,
+@@ -7867,15 +8086,13 @@ doExternal(URLFile uf, char *path, char *type, Buffer **bufp,
UFclose(&uf);
myExec(command->ptr);
}
@@ -16209,7 +16930,7 @@ index 567d41e..9b0e947 100644
}
}
if (mcap->flags & (MAILCAP_HTMLOUTPUT | MAILCAP_COPIOUSOUTPUT)) {
-@@ -7918,14 +8131,13 @@ doExternal(URLFile uf, char *path, char *type, Buffer **bufp,
+@@ -7918,14 +8135,13 @@ doExternal(URLFile uf, char *path, char *type, Buffer **bufp,
buf = NO_BUFFER;
}
if (buf && buf != NO_BUFFER) {
@@ -16228,7 +16949,7 @@ index 567d41e..9b0e947 100644
}
static int
-@@ -7935,7 +8147,8 @@ _MoveFile(char *path1, char *path2)
+@@ -7935,7 +8151,8 @@ _MoveFile(char *path1, char *path2)
FILE *f2;
int is_pipe;
clen_t linelen = 0, trbyte = 0;
@@ -16238,7 +16959,7 @@ index 567d41e..9b0e947 100644
f1 = openIS(path1);
if (f1 == NULL)
-@@ -7953,12 +8166,13 @@ _MoveFile(char *path1, char *path2)
+@@ -7953,12 +8170,13 @@ _MoveFile(char *path1, char *path2)
return -1;
}
current_content_length = 0;
@@ -16256,7 +16977,7 @@ index 567d41e..9b0e947 100644
ISclose(f1);
if (is_pipe)
pclose(f2);
-@@ -7998,7 +8212,7 @@ _doFileCopy(char *tmpf, char *defstr, int download)
+@@ -7998,7 +8216,7 @@ _doFileCopy(char *tmpf, char *defstr, int download)
else {
if (q) {
p = unescape_spaces(Strnew_charp(q))->ptr;
@@ -16265,7 +16986,7 @@ index 567d41e..9b0e947 100644
}
p = expandPath(p);
if (checkOverWrite(p) < 0)
-@@ -8317,21 +8531,23 @@ uncompress_stream(URLFile *uf, char **src)
+@@ -8317,21 +8535,23 @@ uncompress_stream(URLFile *uf, char **src)
}
if (pid2 == 0) {
/* child2 */
@@ -16294,7 +17015,7 @@ index 567d41e..9b0e947 100644
exit(0);
}
/* child1 */
-@@ -8378,7 +8594,7 @@ lessopen_stream(char *path)
+@@ -8378,7 +8598,7 @@ lessopen_stream(char *path)
}
c = getc(fp);
if (c == EOF) {
@@ -17654,7 +18375,7 @@ index b3819a3..2809832 100644
#endif /* INDEP_H */
diff --git a/istream.c b/istream.c
-index 8967280..1387307 100644
+index 8967280..74adac5 100644
--- a/istream.c
+++ b/istream.c
@@ -22,8 +22,8 @@
@@ -17863,11 +18584,7 @@ index 8967280..1387307 100644
- if (sb->buf[sb->cur] == '\n')
- Strcat_char(s, (char)sb->buf[sb->cur++]);
- return s;
-+ if (crnl && gb->length > 0 && gb->ptr[gb->length - 1] == '\r') {
-+ if (sb->buf[sb->cur] == '\n') {
-+ GROWBUF_ADD_CHAR(gb, '\n');
-+ ++sb->cur;
- }
+- }
- for (i = sb->cur;
- i < sb->next && sb->buf[i] != '\n' && sb->buf[i] != '\r';
- i++) ;
@@ -17879,7 +18596,11 @@ index 8967280..1387307 100644
- sb->cur = i + 1;
- if (sb->buf[i] == '\n')
- return s;
-- }
++ if (crnl && gb->length > 0 && gb->ptr[gb->length - 1] == '\r') {
++ if (sb->buf[sb->cur] == '\n') {
++ GROWBUF_ADD_CHAR(gb, '\n');
++ ++sb->cur;
+ }
- else {
- if (s == NULL)
- s = Strnew_size(sb->next - sb->cur + MARGIN_STR_SIZE);
@@ -17964,7 +18685,19 @@ index 8967280..1387307 100644
}
int
-@@ -496,8 +475,6 @@ ssl_check_cert_ident(X509 * x, char *hostname)
+@@ -442,7 +421,11 @@ ssl_check_cert_ident(X509 * x, char *hostname)
+ for (i = 0; i < n; i++) {
+ gn = sk_GENERAL_NAME_value(alt, i);
+ if (gn->type == GEN_DNS) {
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
+ char *sn = ASN1_STRING_data(gn->d.ia5);
++#else
++ char *sn = ASN1_STRING_get0_data(gn->d.ia5);
++#endif
+ int sl = ASN1_STRING_length(gn->d.ia5);
+
+ if (!seen_dnsname)
+@@ -496,8 +479,6 @@ ssl_check_cert_ident(X509 * x, char *hostname)
/* FIXME: gettextize? */
ret = Sprintf("Bad cert ident %s from %s", buf, hostname);
}
@@ -17973,7 +18706,7 @@ index 8967280..1387307 100644
}
return ret;
}
-@@ -645,6 +622,7 @@ basic_close(int *handle)
+@@ -645,6 +626,7 @@ basic_close(int *handle)
#else
close(*(int *)handle);
#endif
@@ -17981,7 +18714,7 @@ index 8967280..1387307 100644
}
static int
-@@ -658,13 +636,14 @@ basic_read(int *handle, char *buf, int len)
+@@ -658,13 +640,14 @@ basic_read(int *handle, char *buf, int len)
}
static void
@@ -17998,7 +18731,7 @@ index 8967280..1387307 100644
{
return fread(buf, 1, len, handle->f);
}
-@@ -682,6 +661,7 @@ ssl_close(struct ssl_handle *handle)
+@@ -682,6 +665,7 @@ ssl_close(struct ssl_handle *handle)
close(handle->sock);
if (handle->ssl)
SSL_free(handle->ssl);
@@ -18006,7 +18739,7 @@ index 8967280..1387307 100644
}
static int
-@@ -717,38 +697,60 @@ static void
+@@ -717,38 +701,60 @@ static void
ens_close(struct ens_handle *handle)
{
ISclose(handle->is);
@@ -19070,7 +19803,7 @@ index b7e81b6..d8f9023 100644
}
else {
diff --git a/local.c b/local.c
-index f5a73a2..46ac579 100644
+index f5a73a2..56d589d 100644
--- a/local.c
+++ b/local.c
@@ -109,6 +109,7 @@ loadLocalDir(char *dname)
@@ -19160,12 +19893,15 @@ index f5a73a2..46ac579 100644
set_cgi_environ(name, file, uri);
if (path_info)
set_environ("PATH_INFO", path_info);
-@@ -415,12 +426,11 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
+@@ -415,12 +426,14 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
}
#ifdef HAVE_CHDIR /* ifndef __EMX__ ? */
- chdir(mydirname(file));
-+ chdir(cgi_dir);
++ if (chdir(cgi_dir) == -1) {
++ fprintf(stderr, "failed to chdir to %s: %s\n", cgi_dir, strerror(errno));
++ exit(1);
++ }
#endif
- execl(file, mybasename(file), NULL);
+ execl(file, cgi_basename, NULL);
@@ -21313,9 +22049,18 @@ index 1489115..ddd267b 100644
-ja
+ja de zh_CN zh_TW
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
-index 83d8838..ef8bd94 100644
+index 83d8838..9d9691e 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
+@@ -89,7 +89,7 @@ CATALOGS = @CATALOGS@
+ @lang=`echo $* | sed -e 's,.*/,,'`; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
+- cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
++ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && if [ x$(GMSGFMT) != x: ] ; then mv t-$${lang}.gmo $${lang}.gmo ; fi
+
+ .sin.sed:
+ sed -e '/^#/d' $< > t-$@
@@ -153,14 +153,14 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
@@ -27451,7 +28196,7 @@ index 569e2fc..ad1cffe 100644
> $(distdir)/w3mman.tar.gz
-rm -fr $(distdir)/w3mman
diff --git a/scripts/w3mman/w3mman.1.in b/scripts/w3mman/w3mman.1.in
-index 1c0361d..8c433a7 100644
+index 1c0361d..68e3afc 100644
--- a/scripts/w3mman/w3mman.1.in
+++ b/scripts/w3mman/w3mman.1.in
@@ -1,4 +1,4 @@
@@ -27460,7 +28205,7 @@ index 1c0361d..8c433a7 100644
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
-@@ -12,36 +12,52 @@
+@@ -12,36 +12,54 @@
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
@@ -27475,9 +28220,9 @@ index 1c0361d..8c433a7 100644
-.RI "[-M " path ] " " [ section ] " page"
+[
+.BI \-M " path"
-+] [
++] [ [
+.I section
-+] [
++]
+.I page
+]
.br
@@ -27485,6 +28230,8 @@ index 1c0361d..8c433a7 100644
-.RI "[-M " path "] -k " keyword
+[
+.BI \-M " path"
++] [
++.I section
+]
+.BI \-k " keyword"
.br
@@ -27525,7 +28272,7 @@ index 1c0361d..8c433a7 100644
.TP
.B W3MMAN_W3M
If W3MMAN_W3M is set, its value is used instead of @W3M@.
-@@ -51,7 +67,7 @@ If W3MMAN_MAN is set, its value is used instead of @MAN@.
+@@ -51,7 +69,7 @@ If W3MMAN_MAN is set, its value is used instead of @MAN@.
.SH FILES
.TP
.I @libexecdir@/@PACKAGE@/cgi-bin/w3mman2html.cgi
@@ -27611,19 +28358,92 @@ index 0000000..d6c5a44
+Markus Hiereth
+.UE
+erstellt.
+diff --git a/scripts/w3mman/w3mman.in b/scripts/w3mman/w3mman.in
+index 6a27e70..fae7a41 100644
+--- a/scripts/w3mman/w3mman.in
++++ b/scripts/w3mman/w3mman.in
+@@ -7,7 +7,7 @@ $SCRIPT = 'file:///$LIB/w3mman2html.cgi';
+ sub usage {
+ ($_ = $0) =~ s@.*/@@;
+ print STDERR "$_ [-M <path>] [[<section>] <command>]\n";
+- print STDERR "$_ [-M <path>] [-k <keyword>]\n";
++ print STDERR "$_ [-M <path>] [<section>] [-k <keyword>]\n";
+ print STDERR "$_ [-l <file>]\n";
+ exit 1;
+ }
+@@ -20,7 +20,8 @@ while (@ARGV) {
+ $ENV{'MANPATH'} = shift @ARGV;
+ } elsif (/^-k$/) {
+ @ARGV || &usage();
+- $query = "?keyword=" . &form_encode(shift @ARGV);
++ if ( $query eq "" ) { $query = "?quit=ok"; }
++ $query .= "&keyword=" . &form_encode(shift @ARGV);
+ } elsif (/^-l$/) {
+ @ARGV || &usage();
+ $query = "?quit=ok&local=" . &form_encode(shift @ARGV);
+@@ -28,11 +29,11 @@ while (@ARGV) {
+ } elsif (/^-/) {
+ &usage();
+ } elsif (/^\d/ || $_ eq 'n') {
+- @ARGV || &usage();
+- $query = "?quit=ok&man=" . &form_encode(shift @ARGV);
++ if ( $query eq "" ) { $query = "?quit=ok"; }
+ $query .= "&section=" . &form_encode($_);
+ } else {
+- $query = "?quit=ok&man=" . &form_encode($_);
++ if ( $query eq "" ) { $query = "?quit=ok"; }
++ $query .= "&man=" . &form_encode($_);
+ }
+ }
+
diff --git a/scripts/w3mman/w3mman2html.cgi.in b/scripts/w3mman/w3mman2html.cgi.in
-index f430307..2cd00f9 100644
+index f430307..d660681 100644
--- a/scripts/w3mman/w3mman2html.cgi.in
+++ b/scripts/w3mman/w3mman2html.cgi.in
-@@ -34,7 +34,6 @@ Content-Type: text/html
+@@ -23,18 +23,23 @@ if ((! $query{"man"}) && (! $query{"local"})) {
+ if ($query{"keyword"}) {
+ $keyword = $query{"keyword"};
+ $k = &html_quote($keyword);
++ if ($query{"section"}) {
++ $section = $query{"section"};
++ $sectionopt = "-s $section ";
++ } else {
++ $sectionopt = "";
++ }
+ print <<EOF;
+ Content-Type: text/html
+
+ <html>
+-<head><title>man -k $k</title></head>
++<head><title>man $sectionopt-k $k</title></head>
+ <body>
+-<h2>man -k <b>$k</b></h2>
++<h2>man $sectionopt-k <b>$k</b></h2>
+ <ul>
EOF
$keyword =~ s:([^-\w\200-\377.,])::g;
- open(F, "$MAN -k $keyword 2> /dev/null |");
+- open(F, "$MAN -k $keyword 2> /dev/null |");
- @line = ();
++ open(F, "$MAN $sectionopt -k $keyword 2> /dev/null |");
while(<F>) {
chop;
$_ = &html_quote($_);
-@@ -126,12 +125,14 @@ while(<F>) {
+@@ -59,10 +64,10 @@ Content-Type: text/html
+ <body>
+ <form action="$CGI">
+ <table>
+-<tr><td>Manual:<td><input name=man>
+-<tr><td>Section:<td><input name=section>
+-<tr><td>Keyword:<td><input name=keyword>
+-<tr><td><td><input type=submit> <input type=reset>
++<tr><td>Manual:<td><input name=man />
++<tr><td>Section:<td><input name=section />
++<tr><td>Keyword:<td><input name=keyword />
++<tr><td><td><input type=submit /> <input type=reset />
+ </table>
+ </form>
+ </body>
+@@ -126,12 +131,14 @@ while(<F>) {
s/\&/\&amp;/g;
s/\</\&lt;/g;
s/\>/\&gt;/g;
@@ -27641,7 +28461,7 @@ index f430307..2cd00f9 100644
s@((\<b\>)?(\&\w+\;|.)(\</b\>)?)\010_@<u>$1</u>@g;
s@.\010(.)@$1@g;
-@@ -156,7 +157,7 @@ EOF
+@@ -156,7 +163,7 @@ EOF
}
s@(http|ftp)://[\w.\-/~]+[\w/]@<a href="$&">$&</a>@g;
@@ -27650,7 +28470,7 @@ index f430307..2cd00f9 100644
s@(\W)(\~?/[\w.][\w.\-/~]*)@$1 . &file_ref($2)@ge;
s@(include(<\/?[bu]\>|\s)*\&lt;)([\w.\-/]+)@$1 . &include_ref($3)@ge;
if ($prev && m@^\s*(\<[bu]\>)*(\w[\w.\-]*)(\</[bu]\>)*(\([\dm]\w*\))@) {
-@@ -220,7 +221,7 @@ sub is_command {
+@@ -220,7 +227,7 @@ sub is_command {
local($p);
(! -d && -x) || return 0;
@@ -27677,7 +28497,7 @@ index 50475ae..c047c56 100644
buf[i] = (*p == ' ') ? NBSP_CODE : *p;
diff --git a/table.c b/table.c
-index e1243ff..4f193e1 100644
+index e1243ff..eb5c9ba 100644
--- a/table.c
+++ b/table.c
@@ -188,7 +188,7 @@ dv2sv(double *dv, short *iv, int size)
@@ -27784,7 +28604,17 @@ index e1243ff..4f193e1 100644
check_maximum_width(t);
#ifdef MATRIX
-@@ -2323,6 +2341,8 @@ feed_table_block_tag(struct table *tbl,
+@@ -2272,7 +2290,8 @@ skip_space(struct table *t, char *line, struct table_linfo *linfo,
+ }
+ if (s > 0) {
+ #ifdef USE_M17N
+- if (ctype == PC_KANJI1 && prev_ctype == PC_KANJI1)
++ if (!SimplePreserveSpace &&
++ ctype == PC_KANJI1 && prev_ctype == PC_KANJI1)
+ skip += s;
+ else
+ #endif
+@@ -2323,6 +2342,8 @@ feed_table_block_tag(struct table *tbl,
int offset;
if (mode->indent_level <= 0 && indent == -1)
return;
@@ -27793,7 +28623,7 @@ index e1243ff..4f193e1 100644
setwidth(tbl, mode);
feed_table_inline_tag(tbl, line, mode, -1);
clearcontentssize(tbl, mode);
-@@ -2336,10 +2356,14 @@ feed_table_block_tag(struct table *tbl,
+@@ -2336,10 +2357,14 @@ feed_table_block_tag(struct table *tbl,
if (mode->indent_level < MAX_INDENT_LEVEL)
tbl->indent -= INDENT_INCR;
}
@@ -27808,7 +28638,7 @@ index e1243ff..4f193e1 100644
}
if (tbl->indent > 0) {
check_minimum0(tbl, 0);
-@@ -2546,8 +2570,10 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
+@@ -2546,8 +2571,10 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
}
}
#ifdef ID_EXT
@@ -27820,7 +28650,7 @@ index e1243ff..4f193e1 100644
#endif /* ID_EXT */
tbl->trattr = align | valign;
break;
-@@ -2572,7 +2598,7 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
+@@ -2572,7 +2599,7 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
}
tbl->col++;
check_row(tbl, tbl->row);
@@ -27829,7 +28659,7 @@ index e1243ff..4f193e1 100644
tbl->col++;
}
if (tbl->col > MAXCOL - 1) {
-@@ -2600,12 +2626,16 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
+@@ -2600,12 +2627,16 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
if ((tbl->row + rowspan) >= tbl->max_rowsize)
check_row(tbl, tbl->row + rowspan);
}
@@ -27846,7 +28676,7 @@ index e1243ff..4f193e1 100644
if (parsedtag_get_value(tag, ATTR_ALIGN, &i)) {
switch (i) {
case ALIGN_LEFT:
-@@ -2878,6 +2908,14 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
+@@ -2878,6 +2909,14 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
tmp = process_input(tag);
feed_table1(tbl, tmp, mode, width);
break;
@@ -27861,7 +28691,7 @@ index e1243ff..4f193e1 100644
case HTML_SELECT:
tmp = process_select(tag);
if (tmp)
-@@ -3010,7 +3048,6 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
+@@ -3010,7 +3049,6 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
break;
case HTML_TABLE_ALT:
id = -1;
@@ -28273,7 +29103,7 @@ index 7a3c987..a636ac0 100644
#define CYGWIN_OFF {fputs("\033[?1000l",ttyf); flush_tty();}
diff --git a/url.c b/url.c
-index ed6062e..d759383 100644
+index ed6062e..1c17e18 100644
--- a/url.c
+++ b/url.c
@@ -121,6 +121,7 @@ static struct table2 DefaultGuess[] = {
@@ -28284,15 +29114,28 @@ index ed6062e..d759383 100644
/* #define HTTP_DEFAULT_FILE "/index.html" */
-@@ -326,6 +327,7 @@ openSSLHandle(int sock, char *hostname, char **p_cert)
+@@ -318,14 +319,19 @@ openSSLHandle(int sock, char *hostname, char **p_cert)
+ #endif /* defined(USE_SSL_VERIFY) */
+ if (ssl_ctx == NULL) {
+ int option;
+-#if SSLEAY_VERSION_NUMBER < 0x0800
++#if OPENSSL_VERSION_NUMBER < 0x0800
+ ssl_ctx = SSL_CTX_new();
+ X509_set_default_verify_paths(ssl_ctx->cert);
+ #else /* SSLEAY_VERSION_NUMBER >= 0x0800 */
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
+ SSLeay_add_ssl_algorithms();
SSL_load_error_strings();
++#else
++ OPENSSL_init_ssl(0, NULL);
++#endif
if (!(ssl_ctx = SSL_CTX_new(SSLv23_client_method())))
goto eend;
+ SSL_CTX_set_cipher_list(ssl_ctx, "DEFAULT:!LOW:!RC4:!EXP");
option = SSL_OP_ALL;
if (ssl_forbid_method) {
if (strchr(ssl_forbid_method, '2'))
-@@ -336,8 +338,20 @@ openSSLHandle(int sock, char *hostname, char **p_cert)
+@@ -336,8 +342,20 @@ openSSLHandle(int sock, char *hostname, char **p_cert)
option |= SSL_OP_NO_TLSv1;
if (strchr(ssl_forbid_method, 'T'))
option |= SSL_OP_NO_TLSv1;
@@ -28313,7 +29156,7 @@ index ed6062e..d759383 100644
#ifdef USE_SSL_VERIFY
/* derived from openssl-0.9.5/apps/s_{client,cb}.c */
#if 1 /* use SSL_get_verify_result() to verify cert */
-@@ -444,6 +458,8 @@ baseURL(Buffer *buf)
+@@ -444,6 +462,8 @@ baseURL(Buffer *buf)
/* <BASE> tag is defined in the document */
return buf->baseURL;
}
@@ -28322,7 +29165,7 @@ index ed6062e..d759383 100644
else
return &buf->currentURL;
}
-@@ -638,16 +654,21 @@ openSocket(char *const hostname,
+@@ -638,16 +658,21 @@ openSocket(char *const hostname,
#define COPYPATH_SPC_ALLOW 0
#define COPYPATH_SPC_IGNORE 1
#define COPYPATH_SPC_REPLACE 2
@@ -28348,7 +29191,7 @@ index ed6062e..d759383 100644
break;
case COPYPATH_SPC_IGNORE:
/* do nothing */
-@@ -658,7 +679,7 @@ copyPath(char *orgpath, int length, int option)
+@@ -658,7 +683,7 @@ copyPath(char *orgpath, int length, int option)
}
}
else
@@ -28357,7 +29200,7 @@ index ed6062e..d759383 100644
orgpath++;
length--;
}
-@@ -668,22 +689,14 @@ copyPath(char *orgpath, int length, int option)
+@@ -668,22 +693,14 @@ copyPath(char *orgpath, int length, int option)
void
parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
{
@@ -28382,7 +29225,7 @@ index ed6062e..d759383 100644
/* RFC1808: Relative Uniform Resource Locators
* 4. Resolving Relative URLs
-@@ -694,7 +707,7 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
+@@ -694,7 +711,7 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
goto do_label;
}
#if defined( __EMX__ ) || defined( __CYGWIN__ )
@@ -28391,7 +29234,7 @@ index ed6062e..d759383 100644
p_url->scheme = SCM_LOCAL;
p += 17 - 1;
url += 17 - 1;
-@@ -802,19 +815,20 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
+@@ -802,19 +819,20 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
/* scheme://user:pass@host or
* scheme://host:port
*/
@@ -28416,7 +29259,7 @@ index ed6062e..d759383 100644
tmp = Strnew_charp_n(q, p - q);
p_url->port = atoi(tmp->ptr);
/* *p is one of ['\0', '/', '?', '#'] */
-@@ -822,15 +836,19 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
+@@ -822,15 +840,19 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
case '@':
/* scheme://user@... */
p_url->user = copyPath(q, p - q, COPYPATH_SPC_IGNORE);
@@ -28439,7 +29282,7 @@ index ed6062e..d759383 100644
break;
}
analyze_file:
-@@ -956,12 +974,16 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
+@@ -956,12 +978,16 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
p_url->label = NULL;
}
@@ -28458,7 +29301,7 @@ index ed6062e..d759383 100644
p->scheme = q->scheme;
p->port = q->port;
p->is_nocache = q->is_nocache;
-@@ -1279,10 +1301,24 @@ getURLScheme(char **url)
+@@ -1279,10 +1305,24 @@ getURLScheme(char **url)
return scheme;
}
@@ -28483,7 +29326,7 @@ index ed6062e..d759383 100644
Strcat_charp(s, "User-Agent: ");
if (UserAgent == NULL || *UserAgent == '\0')
-@@ -1306,7 +1342,12 @@ otherinfo(ParsedURL *target, ParsedURL *current, char *referer)
+@@ -1306,7 +1346,12 @@ otherinfo(ParsedURL *target, ParsedURL *current, char *referer)
Strcat_charp(s, "Pragma: no-cache\r\n");
Strcat_charp(s, "Cache-control: no-cache\r\n");
}
@@ -28497,7 +29340,7 @@ index ed6062e..d759383 100644
#ifdef USE_SSL
if (current && current->scheme == SCM_HTTPS && target->scheme != SCM_HTTPS) {
/* Don't send Referer: if https:// -> http:// */
-@@ -1314,6 +1355,7 @@ otherinfo(ParsedURL *target, ParsedURL *current, char *referer)
+@@ -1314,6 +1359,7 @@ otherinfo(ParsedURL *target, ParsedURL *current, char *referer)
else
#endif
if (referer == NULL && current && current->scheme != SCM_LOCAL &&
@@ -28505,7 +29348,7 @@ index ed6062e..d759383 100644
(current->scheme != SCM_FTP ||
(current->user == NULL && current->pass == NULL))) {
char *p = current->label;
-@@ -1384,7 +1426,6 @@ HTTPrequest(ParsedURL *pu, ParsedURL *current, HRequest *hr, TextList *extra)
+@@ -1384,7 +1430,6 @@ HTTPrequest(ParsedURL *pu, ParsedURL *current, HRequest *hr, TextList *extra)
{
Str tmp;
TextListItem *i;
@@ -28513,7 +29356,7 @@ index ed6062e..d759383 100644
#ifdef USE_COOKIE
Str cookie;
#endif /* USE_COOKIE */
-@@ -1400,7 +1441,6 @@ HTTPrequest(ParsedURL *pu, ParsedURL *current, HRequest *hr, TextList *extra)
+@@ -1400,7 +1445,6 @@ HTTPrequest(ParsedURL *pu, ParsedURL *current, HRequest *hr, TextList *extra)
for (i = extra->first; i != NULL; i = i->next) {
if (strncasecmp(i->ptr, "Authorization:",
sizeof("Authorization:") - 1) == 0) {
@@ -28521,7 +29364,7 @@ index ed6062e..d759383 100644
#ifdef USE_SSL
if (hr->command == HR_COMMAND_CONNECT)
continue;
-@@ -1430,20 +1470,20 @@ HTTPrequest(ParsedURL *pu, ParsedURL *current, HRequest *hr, TextList *extra)
+@@ -1430,20 +1474,20 @@ HTTPrequest(ParsedURL *pu, ParsedURL *current, HRequest *hr, TextList *extra)
#endif /* USE_COOKIE */
if (hr->command == HR_COMMAND_POST) {
if (hr->request->enctype == FORM_ENCTYPE_MULTIPART) {
@@ -28546,7 +29389,7 @@ index ed6062e..d759383 100644
if (header_string)
Strcat(tmp, header_string);
Strcat_charp(tmp, "\r\n");
-@@ -1603,7 +1643,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
+@@ -1603,7 +1647,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
pu->host != NULL && !check_no_proxy(pu->host)) {
hr->flag |= HR_FLAG_PROXY;
sock = openSocket(FTP_proxy_parsed.host,
@@ -28555,7 +29398,7 @@ index ed6062e..d759383 100644
FTP_proxy_parsed.port);
if (sock < 0)
return uf;
-@@ -1645,15 +1685,15 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
+@@ -1645,15 +1689,15 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
}
else if (pu->scheme == SCM_HTTPS) {
sock = openSocket(HTTPS_proxy_parsed.host,
@@ -28575,7 +29418,7 @@ index ed6062e..d759383 100644
#ifdef USE_SSL
sslh = NULL;
}
-@@ -1685,8 +1725,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
+@@ -1685,8 +1729,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
}
}
else {
@@ -28585,7 +29428,25 @@ index ed6062e..d759383 100644
if (sock < 0) {
*status = HTST_MISSING;
return uf;
-@@ -1750,7 +1789,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
+@@ -1713,6 +1756,8 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
+ write(sock, tmp->ptr, tmp->length);
+ if(w3m_reqlog){
+ FILE *ff = fopen(w3m_reqlog, "a");
++ if (ff == NULL)
++ return uf;
+ if (sslh)
+ fputs("HTTPS: request via SSL\n", ff);
+ else
+@@ -1735,6 +1780,8 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
+ write(sock, tmp->ptr, tmp->length);
+ if(w3m_reqlog){
+ FILE *ff = fopen(w3m_reqlog, "a");
++ if (ff == NULL)
++ return uf;
+ fwrite(tmp->ptr, sizeof(char), tmp->length, ff);
+ fclose(ff);
+ }
+@@ -1750,7 +1797,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
pu->host != NULL && !check_no_proxy(pu->host)) {
hr->flag |= HR_FLAG_PROXY;
sock = openSocket(GOPHER_proxy_parsed.host,
@@ -28594,7 +29455,7 @@ index ed6062e..d759383 100644
GOPHER_proxy_parsed.port);
if (sock < 0)
return uf;
-@@ -1758,8 +1797,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
+@@ -1758,8 +1805,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
tmp = HTTPrequest(pu, current, hr, extra_header);
}
else {
@@ -28604,7 +29465,7 @@ index ed6062e..d759383 100644
if (sock < 0)
return uf;
if (pu->file == NULL)
-@@ -2049,7 +2087,7 @@ filename_extension(char *path, int is_url)
+@@ -2049,7 +2095,7 @@ filename_extension(char *path, int is_url)
break;
}
if (*last_dot == '.') {
@@ -28613,7 +29474,7 @@ index ed6062e..d759383 100644
if (is_url && !IS_ALNUM(last_dot[i]))
break;
}
-@@ -2234,3 +2272,66 @@ schemeToProxy(int scheme)
+@@ -2234,3 +2280,66 @@ schemeToProxy(int scheme)
}
return pu;
}
@@ -29735,6 +30596,18 @@ index 36e3b62..f1e8d97 100644
#endif
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "fb.h"
+diff --git a/w3mimg/fb/fb_imlib2.c b/w3mimg/fb/fb_imlib2.c
+index ea36637..1a5151c 100644
+--- a/w3mimg/fb/fb_imlib2.c
++++ b/w3mimg/fb/fb_imlib2.c
+@@ -3,7 +3,6 @@
+ fb_imlib2.c 0.3 Copyright (C) 2002, hito
+ **************************************************************************/
+
+-#include <X11/Xlib.h>
+ #include <Imlib2.h>
+ #include "fb.h"
+ #include "fb_img.h"
diff --git a/w3mimg/fb/fb_w3mimg.c b/w3mimg/fb/fb_w3mimg.c
index d3ae5a9..62511f0 100644
--- a/w3mimg/fb/fb_w3mimg.c