diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/ChangeLog wget-1.5.1/ChangeLog --- wget-1.5.0/ChangeLog Sun Apr 19 18:23:03 1998 +++ wget-1.5.1/ChangeLog Fri May 1 18:50:30 1998 @@ -1,3 +1,17 @@ +1998-04-30 Douglas E. Wegscheid + + * windows/config.h.bor: New file. + + * windows/makefile.bor: New file. + +1998-04-27 John Burden + + * windows/Makefile.*: Cleanup. + +1998-04-27 Gregor Hoffleit + + * configure.in: Check for PID_T. + 1998-04-19 Giovanni Bortolozzo * po/it.po: Updated. diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/NEWS wget-1.5.1/NEWS --- wget-1.5.0/NEWS Mon Apr 20 01:25:21 1998 +++ wget-1.5.1/NEWS Fri Apr 24 00:34:27 1998 @@ -5,6 +5,8 @@ Please send GNU Wget bug reports to . +* Wget 1.5.1 is a bugfix release with no user-visible changes. + * Changes in Wget 1.5.0 ** Wget speaks many languages! @@ -21,7 +23,7 @@ ** The `-I' and `-X' options now accept wildcard arguments. -** The `-w' option now accepts suffices `s' for seconds, `m' for +** The `-w' option now accepts suffixes `s' for seconds, `m' for minutes, `h' for hours, `d' for days and `w' for weeks. ** Upon getting SIGHUP, the whole previous log is now copied to diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/README wget-1.5.1/README --- wget-1.5.0/README Mon Apr 20 01:37:21 1998 +++ wget-1.5.1/README Tue May 5 09:11:50 1998 @@ -38,8 +38,8 @@ Like all GNU utilities, the latest version of Wget can be found at the master GNU archive site prep.ai.mit.edu, and its mirrors. For -example, Wget 1.5.0 is at: -. +example, Wget 1.5.1 is at: +. The latest version is also available via FTP from the maintainer's machine, at: diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/TODO wget-1.5.1/TODO --- wget-1.5.0/TODO Mon Apr 20 01:49:37 1998 +++ wget-1.5.1/TODO Tue Apr 28 07:06:31 1998 @@ -58,6 +58,8 @@ * Add more protocols (e.g. gopher and news), implementing them in a modular fashion. +* Implement a concept of "packages" a la mirror. + * Implement more HTTP/1.1 bells and whistles. * Support SSL encryption through SSLeay. diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/configure wget-1.5.1/configure --- wget-1.5.0/configure Sat Apr 4 23:27:27 1998 +++ wget-1.5.1/configure Mon Apr 27 21:31:50 1998 @@ -1334,15 +1334,48 @@ fi +echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +echo "configure:1339: checking for pid_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_pid_t=yes +else + rm -rf conftest* + ac_cv_type_pid_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_pid_t" 1>&6 +if test $ac_cv_type_pid_t = no; then + cat >> confdefs.h <<\EOF +#define pid_t int +EOF + +fi + echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1339: checking whether byte ordering is bigendian" >&5 +echo "configure:1372: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1353,11 +1386,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:1357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1368,7 +1401,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:1372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1388,7 +1421,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1429,17 +1462,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1433: checking for $ac_hdr" >&5 +echo "configure:1466: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1469,17 +1502,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1473: checking for $ac_hdr" >&5 +echo "configure:1506: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1516: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1506,12 +1539,12 @@ done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1510: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1543: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1520,7 +1553,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1542,12 +1575,12 @@ echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1546: checking return type of signal handlers" >&5 +echo "configure:1579: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1564,7 +1597,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:1568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1584,10 +1617,10 @@ echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 -echo "configure:1588: checking for struct utimbuf" >&5 +echo "configure:1621: checking for struct utimbuf" >&5 if test x"$ac_cv_header_utime_h" = xyes; then cat > conftest.$ac_ext < EOF @@ -1612,19 +1645,19 @@ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1616: checking for working alloca.h" >&5 +echo "configure:1649: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1645,12 +1678,12 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1649: checking for alloca" >&5 +echo "configure:1682: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1705,12 +1738,12 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1709: checking whether alloca needs Cray hooks" >&5 +echo "configure:1742: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:1739: checking for $ac_func" >&5 +echo "configure:1772: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1790,7 +1823,7 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1794: checking stack direction for C alloca" >&5 +echo "configure:1827: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1798,7 +1831,7 @@ ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -1841,12 +1874,12 @@ for ac_func in strdup strstr strcasecmp strncasecmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1845: checking for $ac_func" >&5 +echo "configure:1878: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1896,12 +1929,12 @@ for ac_func in gettimeofday mktime strptime do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1900: checking for $ac_func" >&5 +echo "configure:1933: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1951,12 +1984,12 @@ for ac_func in strerror vsnprintf select signal symlink isatty do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1955: checking for $ac_func" >&5 +echo "configure:1988: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2006,12 +2039,12 @@ for ac_func in uname gethostname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2010: checking for $ac_func" >&5 +echo "configure:2043: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2062,12 +2095,12 @@ for ac_func in gethostbyname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2066: checking for $ac_func" >&5 +echo "configure:2099: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2112,7 +2145,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:2116: checking for gethostbyname in -lnsl" >&5 +echo "configure:2149: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2120,7 +2153,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2165,7 +2198,7 @@ echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:2169: checking for socket in -lsocket" >&5 +echo "configure:2202: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2173,7 +2206,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2215,7 +2248,7 @@ if test "x${with_socks}" = xyes then echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6 -echo "configure:2219: checking for main in -lresolv" >&5 +echo "configure:2252: checking for main in -lresolv" >&5 ac_lib_var=`echo resolv'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2223,14 +2256,14 @@ ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2258,7 +2291,7 @@ fi echo $ac_n "checking for Rconnect in -lsocks""... $ac_c" 1>&6 -echo "configure:2262: checking for Rconnect in -lsocks" >&5 +echo "configure:2295: checking for Rconnect in -lsocks" >&5 ac_lib_var=`echo socks'_'Rconnect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2266,7 +2299,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocks $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2309,7 +2342,7 @@ ALL_LINGUAS="cs de hr no it pt_BR" echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2313: checking whether NLS is requested" >&5 +echo "configure:2346: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2325,7 +2358,7 @@ # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2329: checking for $ac_word" >&5 +echo "configure:2362: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2359,7 +2392,7 @@ # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2363: checking for $ac_word" >&5 +echo "configure:2396: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2394,7 +2427,7 @@ # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2398: checking for $ac_word" >&5 +echo "configure:2431: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2440,17 +2473,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2444: checking for $ac_hdr" >&5 +echo "configure:2477: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2480,12 +2513,12 @@ for ac_func in gettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2484: checking for $ac_func" >&5 +echo "configure:2517: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2530,7 +2563,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:2534: checking for gettext in -lintl" >&5 +echo "configure:2567: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2538,7 +2571,7 @@ ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2617,7 +2650,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2621: checking for $ac_word" >&5 +echo "configure:2654: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/configure.in wget-1.5.1/configure.in --- wget-1.5.0/configure.in Sat Apr 4 05:35:29 1998 +++ wget-1.5.1/configure.in Mon Apr 27 21:10:25 1998 @@ -122,6 +122,7 @@ dnl AC_C_CONST AC_TYPE_SIZE_T +AC_TYPE_PID_T dnl #### This generates a warning. What do I do to shut it up? AC_C_BIGENDIAN diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/doc/ChangeLog wget-1.5.1/doc/ChangeLog --- wget-1.5.0/doc/ChangeLog Sat Apr 18 15:55:51 1998 +++ wget-1.5.1/doc/ChangeLog Sat May 2 04:59:18 1998 @@ -1,3 +1,8 @@ +1998-05-02 Hrvoje Niksic + + * wget.texi (Recursive Retrieval): Fix typo. Suggested by + Francois Pinard. + 1998-04-18 Hrvoje Niksic * wget.texi: Fixed @dircategory, courtesy Karl Eichwalder. diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/doc/wget.texi wget-1.5.1/doc/wget.texi --- wget-1.5.0/doc/wget.texi Mon Apr 20 00:42:01 1998 +++ wget-1.5.1/doc/wget.texi Tue May 5 09:12:14 1998 @@ -26,11 +26,11 @@ @titlepage @title Wget -@subtitle Version 1.5.0, February, 1998 +@subtitle Version 1.5.1, February, 1998 @author by Hrvoje Nik@v{s}i@'{c} @sp 4 -@center Complete Reference, Updated for Wget Version 1.5.0 +@center Complete Reference, Updated for Wget Version 1.5.1 @center Copyright @copyright{} 1996, 1997, 1998 Free Software Foundation, Inc. @sp 4 @@ -74,9 +74,9 @@ @ifinfo @node Top, Overview, (dir), (dir) -@top Wget 1.5.0 +@top Wget 1.5.1 -This manual documents version 1.5.0 of GNU Wget, the freely available +This manual documents version 1.5.1 of GNU Wget, the freely available utility for network download. Copyright @copyright{} 1996, 1997, 1998 Free Software Foundation, Inc. @@ -851,7 +851,7 @@ @table @samp @item -A @var{acclist} --accept @var{acclist} @itemx -R @var{rejlist} --reject @var{rejlist} -Specify comma-separated lists of file name suffices or patterns to +Specify comma-separated lists of file name suffixes or patterns to accept or reject (@xref{Types of Files} for more details). @item -D @var{domain-list} @@ -923,14 +923,14 @@ @code{src}. If the freshly downloaded file is also of type @code{text/html}, it will be parsed and followed further. -The maximum ``depth'' to which the retrieval may descend is specified +The maximum @dfn{depth} to which the retrieval may descend is specified with the @samp{-l} option (the default maximum depth is five layers). @xref{Recursive Retrieval}. When retrieving an @sc{ftp} @sc{url} recursively, Wget will retrieve all the data from the given directory tree (including the subdirectories up to the specified depth) on the remote server, creating its mirror image -locally. @sc{ftp} retrieval is also limited by the @code{dept} +locally. @sc{ftp} retrieval is also limited by the @code{depth} parameter. By default, Wget will create a local directory tree, corresponding to @@ -2108,10 +2108,10 @@ Like all GNU utilities, the latest version of Wget can be found at the master GNU archive site prep.ai.mit.edu, and its mirrors. For example, -Wget 1.5.0 is at: +Wget 1.5.1 is at: @example -. +. @end example I'll try to make a ``real'' home page for Wget some time in the future. @@ -2423,9 +2423,9 @@ @section Security Considerations @cindex security -When using Wget, you must be aware that it is sends unencrypted -passwords through the network, which may present a security problem. -Here are the main issues, and some solutions. +When using Wget, you must be aware that it sends unencrypted passwords +through the network, which may present a security problem. Here are the +main issues, and some solutions. @enumerate @item @@ -2532,6 +2532,7 @@ Dieter Baron, Roger Beeman and the Gurus at Cisco, Mark Boyns, +John Burden, Wanderlei Cavassin, Gilles Cedoc, Noel Cragg, @@ -2595,6 +2596,7 @@ Markus Strasser, Mike Thomas, Russell Vincent, +Douglas E. Wegscheid, Jasmin Zainul, @iftex Bojan @v{Z}drnja, Binary files wget-1.5.0/po/cs.gmo and wget-1.5.1/po/cs.gmo differ Binary files wget-1.5.0/po/de.gmo and wget-1.5.1/po/de.gmo differ Binary files wget-1.5.0/po/hr.gmo and wget-1.5.1/po/hr.gmo differ Binary files wget-1.5.0/po/it.gmo and wget-1.5.1/po/it.gmo differ Binary files wget-1.5.0/po/messages and wget-1.5.1/po/messages differ Binary files wget-1.5.0/po/no.gmo and wget-1.5.1/po/no.gmo differ Binary files wget-1.5.0/po/pt_BR.gmo and wget-1.5.1/po/pt_BR.gmo differ diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/po/wget.pot wget-1.5.1/po/wget.pot --- wget-1.5.0/po/wget.pot Thu Apr 16 07:14:32 1998 +++ wget-1.5.1/po/wget.pot Tue May 5 08:56:58 1998 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1998-04-16 07:14+0200\n" +"POT-Creation-Date: 1998-05-05 08:56+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,250 +16,250 @@ #. Login to the server: #. First: Establish the control connection. -#: src/ftp.c:147 src/http.c:329 +#: src/ftp.c:146 src/http.c:335 #, c-format msgid "Connecting to %s:%hu... " msgstr "" -#: src/ftp.c:169 src/ftp.c:410 src/http.c:346 +#: src/ftp.c:168 src/ftp.c:409 src/http.c:352 #, c-format msgid "Connection to %s:%hu refused.\n" msgstr "" #. Second: Login with proper USER/PASS sequence. -#: src/ftp.c:190 src/http.c:357 +#: src/ftp.c:189 src/http.c:363 msgid "connected!\n" msgstr "" -#: src/ftp.c:191 +#: src/ftp.c:190 #, c-format msgid "Logging in as %s ... " msgstr "" -#: src/ftp.c:200 src/ftp.c:252 src/ftp.c:300 src/ftp.c:352 src/ftp.c:446 -#: src/ftp.c:519 src/ftp.c:567 src/ftp.c:615 +#: src/ftp.c:199 src/ftp.c:251 src/ftp.c:299 src/ftp.c:351 src/ftp.c:445 +#: src/ftp.c:518 src/ftp.c:566 src/ftp.c:614 msgid "Error in server response, closing control connection.\n" msgstr "" -#: src/ftp.c:208 +#: src/ftp.c:207 msgid "Error in server greeting.\n" msgstr "" -#: src/ftp.c:215 src/ftp.c:261 src/ftp.c:309 src/ftp.c:361 src/ftp.c:456 -#: src/ftp.c:529 src/ftp.c:577 src/ftp.c:625 +#: src/ftp.c:214 src/ftp.c:260 src/ftp.c:308 src/ftp.c:360 src/ftp.c:455 +#: src/ftp.c:528 src/ftp.c:576 src/ftp.c:624 msgid "Write failed, closing control connection.\n" msgstr "" -#: src/ftp.c:222 +#: src/ftp.c:221 msgid "The server refuses login.\n" msgstr "" -#: src/ftp.c:229 +#: src/ftp.c:228 msgid "Login incorrect.\n" msgstr "" -#: src/ftp.c:236 +#: src/ftp.c:235 msgid "Logged in!\n" msgstr "" -#: src/ftp.c:269 +#: src/ftp.c:268 #, c-format msgid "Unknown type `%c', closing control connection.\n" msgstr "" -#: src/ftp.c:282 +#: src/ftp.c:281 msgid "done. " msgstr "" -#: src/ftp.c:288 +#: src/ftp.c:287 msgid "==> CWD not needed.\n" msgstr "" -#: src/ftp.c:316 +#: src/ftp.c:315 #, c-format msgid "" "No such directory `%s'.\n" "\n" msgstr "" -#: src/ftp.c:330 src/ftp.c:598 src/ftp.c:646 src/url.c:1387 +#: src/ftp.c:329 src/ftp.c:597 src/ftp.c:645 src/url.c:1421 msgid "done.\n" msgstr "" #. do not CWD -#: src/ftp.c:334 +#: src/ftp.c:333 msgid "==> CWD not required.\n" msgstr "" -#: src/ftp.c:368 +#: src/ftp.c:367 msgid "Cannot initiate PASV transfer.\n" msgstr "" -#: src/ftp.c:372 +#: src/ftp.c:371 msgid "Cannot parse PASV response.\n" msgstr "" -#: src/ftp.c:386 +#: src/ftp.c:385 #, c-format msgid "Will try connecting to %s:%hu.\n" msgstr "" -#: src/ftp.c:473 +#: src/ftp.c:472 #, c-format msgid "Bind error (%s).\n" msgstr "" -#: src/ftp.c:489 +#: src/ftp.c:488 msgid "Invalid PORT.\n" msgstr "" -#: src/ftp.c:503 src/ftp.c:547 +#: src/ftp.c:502 src/ftp.c:546 msgid "done. " msgstr "" -#: src/ftp.c:536 +#: src/ftp.c:535 msgid "" "\n" "REST failed, starting from scratch.\n" msgstr "" -#: src/ftp.c:585 +#: src/ftp.c:584 #, c-format msgid "" "No such file `%s'.\n" "\n" msgstr "" -#: src/ftp.c:633 +#: src/ftp.c:632 #, c-format msgid "" "No such file or directory `%s'.\n" "\n" msgstr "" -#: src/ftp.c:691 src/ftp.c:698 +#: src/ftp.c:690 src/ftp.c:697 #, c-format msgid "Length: %s" msgstr "" -#: src/ftp.c:693 src/ftp.c:700 +#: src/ftp.c:692 src/ftp.c:699 #, c-format msgid " [%s to go]" msgstr "" -#: src/ftp.c:702 +#: src/ftp.c:701 msgid " (unauthoritative)\n" msgstr "" -#: src/ftp.c:720 +#: src/ftp.c:719 #, c-format msgid "%s: %s, closing control connection.\n" msgstr "" -#: src/ftp.c:728 +#: src/ftp.c:727 #, c-format msgid "%s (%s) - Data connection: %s; " msgstr "" -#: src/ftp.c:745 +#: src/ftp.c:744 msgid "Control connection closed.\n" msgstr "" -#: src/ftp.c:763 +#: src/ftp.c:762 msgid "Data transfer aborted.\n" msgstr "" -#: src/ftp.c:829 +#: src/ftp.c:828 #, c-format msgid "File `%s' already there, not retrieving.\n" msgstr "" -#: src/ftp.c:895 src/http.c:870 +#: src/ftp.c:894 src/http.c:911 #, c-format msgid "(try:%2d)" msgstr "" -#: src/ftp.c:954 src/http.c:1055 +#: src/ftp.c:953 src/http.c:1097 #, c-format msgid "" "%s (%s) - `%s' saved [%ld]\n" "\n" msgstr "" -#: src/ftp.c:1000 +#: src/ftp.c:999 #, c-format msgid "Using `%s' as listing tmp file.\n" msgstr "" -#: src/ftp.c:1012 +#: src/ftp.c:1011 #, c-format msgid "Removed `%s'.\n" msgstr "" -#: src/ftp.c:1048 +#: src/ftp.c:1047 #, c-format msgid "Recursion depth %d exceeded max. depth %d.\n" msgstr "" -#: src/ftp.c:1095 src/http.c:994 +#: src/ftp.c:1094 src/http.c:1035 #, c-format msgid "" "Local file `%s' is more recent, not retrieving.\n" "\n" msgstr "" -#: src/ftp.c:1101 src/http.c:1000 +#: src/ftp.c:1100 src/http.c:1041 #, c-format msgid "The sizes do not match (local %ld), retrieving.\n" msgstr "" -#: src/ftp.c:1118 +#: src/ftp.c:1117 msgid "Invalid name of the symlink, skipping.\n" msgstr "" -#: src/ftp.c:1135 +#: src/ftp.c:1134 #, c-format msgid "" "Already have correct symlink %s -> %s\n" "\n" msgstr "" -#: src/ftp.c:1142 +#: src/ftp.c:1141 #, c-format msgid "Creating symlink %s -> %s\n" msgstr "" -#: src/ftp.c:1153 +#: src/ftp.c:1152 #, c-format msgid "Symlinks not supported, skipping symlink `%s'.\n" msgstr "" -#: src/ftp.c:1165 +#: src/ftp.c:1164 #, c-format msgid "Skipping directory `%s'.\n" msgstr "" -#: src/ftp.c:1174 +#: src/ftp.c:1173 #, c-format msgid "%s: unknown/unsupported file type.\n" msgstr "" -#: src/ftp.c:1190 +#: src/ftp.c:1189 #, c-format msgid "%s: corrupt time-stamp.\n" msgstr "" -#: src/ftp.c:1210 +#: src/ftp.c:1209 #, c-format msgid "Will not retrieve dirs since depth is %d (max %d).\n" msgstr "" -#: src/ftp.c:1249 +#: src/ftp.c:1248 #, c-format msgid "Not descending to `%s' as it is excluded/not-included.\n" msgstr "" -#: src/ftp.c:1294 +#: src/ftp.c:1293 #, c-format msgid "Rejecting `%s'.\n" msgstr "" @@ -267,17 +267,17 @@ #. No luck. #. #### This message SUCKS. We should see what was the #. reason that nothing was retrieved. -#: src/ftp.c:1341 +#: src/ftp.c:1340 #, c-format msgid "No matches on pattern `%s'.\n" msgstr "" -#: src/ftp.c:1401 +#: src/ftp.c:1400 #, c-format msgid "Wrote HTML-ized index to `%s' [%ld].\n" msgstr "" -#: src/ftp.c:1406 +#: src/ftp.c:1405 #, c-format msgid "Wrote HTML-ized index to `%s'.\n" msgstr "" @@ -342,331 +342,269 @@ msgstr "" #: src/host.c:432 -msgid "wget: Cannot determine user-id.\n" +#, c-format +msgid "%s: Cannot determine user-id.\n" msgstr "" -#: src/host.c:443 +#: src/host.c:444 #, c-format -msgid "wget: Warning: uname failed: %s\n" +msgid "%s: Warning: uname failed: %s\n" msgstr "" -#: src/host.c:455 -msgid "wget: Warning: gethostname failed\n" +#: src/host.c:456 +#, c-format +msgid "%s: Warning: gethostname failed\n" msgstr "" -#: src/host.c:482 -msgid "wget: Warning: cannot determine local IP address.\n" +#: src/host.c:484 +#, c-format +msgid "%s: Warning: cannot determine local IP address.\n" msgstr "" -#: src/host.c:495 -msgid "wget: Warning: cannot reverse-lookup local IP address.\n" +#: src/host.c:498 +#, c-format +msgid "%s: Warning: cannot reverse-lookup local IP address.\n" msgstr "" -#: src/host.c:502 -msgid "wget: Warning: reverse-lookup of local address did not yield FQDN!\n" +#: src/host.c:506 +#, c-format +msgid "%s: Warning: reverse-lookup of local address did not yield FQDN!\n" msgstr "" -#: src/host.c:528 +#: src/host.c:533 msgid "Host not found" msgstr "" -#: src/host.c:530 +#: src/host.c:535 msgid "Unknown error" msgstr "" -#: src/html.c:435 src/html.c:437 +#: src/html.c:433 src/html.c:435 #, c-format msgid "Index of /%s on %s:%d" msgstr "" -#: src/html.c:453 +#: src/html.c:457 msgid "time unknown " msgstr "" -#: src/html.c:457 +#: src/html.c:461 msgid "File " msgstr "" -#: src/html.c:460 +#: src/html.c:464 msgid "Directory " msgstr "" -#: src/html.c:463 +#: src/html.c:467 msgid "Link " msgstr "" -#: src/html.c:466 +#: src/html.c:470 msgid "Not sure " msgstr "" -#: src/html.c:484 +#: src/html.c:488 #, c-format msgid " (%s bytes)" msgstr "" -#: src/http.c:472 +#: src/http.c:481 msgid "Failed writing HTTP request.\n" msgstr "" -#: src/http.c:477 +#: src/http.c:486 #, c-format -msgid "%s request sent, fetching headers... " +msgid "%s request sent, awaiting response... " msgstr "" -#: src/http.c:516 +#: src/http.c:525 msgid "End of file while parsing headers.\n" msgstr "" -#: src/http.c:527 +#: src/http.c:536 #, c-format msgid "Read error (%s) in headers.\n" msgstr "" -#: src/http.c:563 +#: src/http.c:576 +msgid "No data received" +msgstr "" + +#: src/http.c:578 msgid "Malformed status line" msgstr "" -#: src/http.c:568 +#: src/http.c:583 msgid "(no description)" msgstr "" -#: src/http.c:685 -msgid "done." +#. If we have tried it already, then there is not point +#. retrying it. +#: src/http.c:667 +msgid "Authorization failed.\n" msgstr "" -#: src/http.c:701 +#: src/http.c:674 +msgid "Unknown authentication scheme.\n" +msgstr "" + +#: src/http.c:737 #, c-format msgid "Location: %s%s\n" msgstr "" -#: src/http.c:702 src/http.c:727 +#: src/http.c:738 src/http.c:763 msgid "unspecified" msgstr "" -#: src/http.c:703 +#: src/http.c:739 msgid " [following]" msgstr "" #. No need to print this output if the body won't be #. downloaded at all, or if the original server response is #. printed. -#: src/http.c:717 +#: src/http.c:753 msgid "Length: " msgstr "" -#: src/http.c:722 +#: src/http.c:758 #, c-format msgid " (%s to go)" msgstr "" -#: src/http.c:727 +#: src/http.c:763 msgid "ignored" msgstr "" -#: src/http.c:808 +#: src/http.c:846 msgid "Warning: wildcards not supported in HTTP.\n" msgstr "" #. If opt.noclobber is turned on and file already exists, do not #. retrieve the file -#: src/http.c:822 +#: src/http.c:861 #, c-format msgid "File `%s' already there, will not retrieve.\n" msgstr "" -#: src/http.c:926 +#: src/http.c:967 #, c-format msgid "Cannot write to `%s' (%s).\n" msgstr "" -#: src/http.c:936 +#: src/http.c:977 #, c-format msgid "ERROR: Redirection (%d) without location.\n" msgstr "" -#: src/http.c:952 +#: src/http.c:993 #, c-format msgid "%s ERROR %d: %s.\n" msgstr "" -#: src/http.c:964 +#: src/http.c:1005 msgid "Last-modified header missing -- time-stamps turned off.\n" msgstr "" -#: src/http.c:972 +#: src/http.c:1013 msgid "Last-modified header invalid -- time-stamp ignored.\n" msgstr "" -#: src/http.c:1004 +#: src/http.c:1045 msgid "Remote file is newer, retrieving.\n" msgstr "" -#: src/http.c:1037 +#: src/http.c:1079 #, c-format msgid "" "%s (%s) - `%s' saved [%ld/%ld]\n" "\n" msgstr "" -#: src/http.c:1069 +#: src/http.c:1111 #, c-format msgid "%s (%s) - Connection closed at byte %ld. " msgstr "" -#: src/http.c:1077 +#: src/http.c:1119 #, c-format msgid "" "%s (%s) - `%s' saved [%ld/%ld])\n" "\n" msgstr "" -#: src/http.c:1089 +#: src/http.c:1131 #, c-format msgid "%s (%s) - Connection closed at byte %ld/%ld. " msgstr "" -#: src/http.c:1100 +#: src/http.c:1142 #, c-format msgid "%s (%s) - Read error at byte %ld (%s)." msgstr "" -#: src/http.c:1108 +#: src/http.c:1150 #, c-format msgid "%s (%s) - Read error at byte %ld/%ld (%s). " msgstr "" #: src/init.c:311 src/netrc.c:246 #, c-format -msgid "wget: Cannot read %s (%s).\n" +msgid "%s: Cannot read %s (%s).\n" msgstr "" -#: src/init.c:332 src/init.c:337 +#: src/init.c:332 src/init.c:338 #, c-format -msgid "wget: Error in %s at line %d.\n" +msgid "%s: Error in %s at line %d.\n" msgstr "" -#: src/init.c:367 +#: src/init.c:369 #, c-format -msgid "wget: Warning: Both system and user wgetrc point to `%s'.\n" +msgid "%s: Warning: Both system and user wgetrc point to `%s'.\n" msgstr "" -#: src/init.c:458 +#: src/init.c:460 #, c-format -msgid "wget: Unknown command `%s', value `%s'.\n" +msgid "%s: BUG: unknown command `%s', value `%s'.\n" msgstr "" -#: src/init.c:485 +#: src/init.c:487 #, c-format -msgid "wget: %s: Please specify on or off.\n" +msgid "%s: %s: Please specify on or off.\n" msgstr "" -#: src/init.c:502 src/init.c:758 src/init.c:780 src/init.c:853 +#: src/init.c:505 src/init.c:762 src/init.c:784 src/init.c:857 #, c-format -msgid "wget: %s: Invalid specification `%s'.\n" +msgid "%s: %s: Invalid specification `%s'.\n" msgstr "" -#: src/init.c:614 src/init.c:636 src/init.c:658 src/init.c:684 +#: src/init.c:618 src/init.c:640 src/init.c:662 src/init.c:688 #, c-format msgid "%s: Invalid specification `%s'\n" msgstr "" -#: src/main.c:233 -msgid "wget: debug support not compiled in.\n" -msgstr "" - -#: src/main.c:280 -msgid "" -"Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.\n" -"This program is distributed in the hope that it will be useful,\n" -"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" -"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" -"GNU General Public License for more details.\n" -msgstr "" - -#: src/main.c:286 -msgid "" -"\n" -"Written by Hrvoje Niksic .\n" -msgstr "" - -#: src/main.c:350 -#, c-format -msgid "wget: %s: invalid command\n" -msgstr "" - -#: src/main.c:396 -#, c-format -msgid "wget: illegal option -- `-n%c'\n" -msgstr "" - -#. #### Something nicer should be printed here -- similar to the -#. pre-1.5 `--help' page. -#: src/main.c:398 src/main.c:438 src/main.c:469 -#, c-format -msgid "Try `%s --help' for more options.\n" -msgstr "" - -#: src/main.c:449 -msgid "Can't be verbose and quiet at the same time.\n" -msgstr "" - -#: src/main.c:455 -msgid "Can't timestamp and not clobber old files at the same time.\n" -msgstr "" - -#. No URL specified. -#: src/main.c:464 -msgid "wget: missing URL\n" -msgstr "" - -#. Parent -#: src/main.c:495 -msgid "Continuing in background.\n" -msgstr "" - -#: src/main.c:497 -#, c-format -msgid "Output will be written to `%s'.\n" -msgstr "" - -#: src/main.c:575 -#, c-format -msgid "No URLs found in %s.\n" -msgstr "" - -#: src/main.c:584 -#, c-format -msgid "" -"\n" -"FINISHED --%s--\n" -"Downloaded: %s bytes in %d files\n" -msgstr "" - -#: src/main.c:589 -#, c-format -msgid "Download quota (%s bytes) EXCEEDED!\n" -msgstr "" - -#: src/main.c:631 +#: src/main.c:101 #, c-format msgid "Usage: %s [OPTION]... [URL]...\n" msgstr "" -#: src/main.c:639 +#: src/main.c:109 #, c-format msgid "GNU Wget %s, a non-interactive network retriever.\n" msgstr "" #. Had to split this in parts, so the #@@#%# Ultrix compiler and cpp #. don't bitch. Also, it makes translation much easier. -#: src/main.c:644 +#: src/main.c:114 msgid "" "\n" "Mandatory arguments to long options are mandatory for short options too.\n" "\n" msgstr "" -#: src/main.c:647 +#: src/main.c:117 msgid "" "Startup:\n" " -V, --version display the version of Wget and exit.\n" @@ -676,7 +614,7 @@ "\n" msgstr "" -#: src/main.c:653 +#: src/main.c:123 msgid "" "Logging and input file:\n" " -o, --output-file=FILE log messages to FILE.\n" @@ -690,7 +628,7 @@ "\n" msgstr "" -#: src/main.c:663 +#: src/main.c:133 msgid "" "Download:\n" " -t, --tries=NUMBER set number of retries to NUMBER (0 " @@ -709,7 +647,7 @@ "\n" msgstr "" -#: src/main.c:677 +#: src/main.c:147 msgid "" "Directories:\n" " -nd --no-directories don't create directories.\n" @@ -721,7 +659,7 @@ "\n" msgstr "" -#: src/main.c:684 +#: src/main.c:154 msgid "" "HTTP options:\n" " --http-user=USER set http user to USER.\n" @@ -737,7 +675,7 @@ "\n" msgstr "" -#: src/main.c:695 +#: src/main.c:165 msgid "" "FTP options:\n" " --retr-symlinks retrieve FTP symbolic links.\n" @@ -746,7 +684,7 @@ "\n" msgstr "" -#: src/main.c:700 +#: src/main.c:170 msgid "" "Recursive retrieval:\n" " -r, --recursive recursive web-suck -- use with care!.\n" @@ -758,7 +696,7 @@ "\n" msgstr "" -#: src/main.c:708 +#: src/main.c:178 msgid "" "Recursive accept/reject:\n" " -A, --accept=LIST list of accepted extensions.\n" @@ -776,21 +714,86 @@ "\n" msgstr "" -#: src/main.c:721 +#: src/main.c:191 msgid "Mail bug reports and suggestions to .\n" msgstr "" +#: src/main.c:347 +#, c-format +msgid "%s: debug support not compiled in.\n" +msgstr "" + +#: src/main.c:395 +msgid "" +"Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.\n" +"This program is distributed in the hope that it will be useful,\n" +"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +"GNU General Public License for more details.\n" +msgstr "" + +#: src/main.c:401 +msgid "" +"\n" +"Written by Hrvoje Niksic .\n" +msgstr "" + +#: src/main.c:465 +#, c-format +msgid "%s: %s: invalid command\n" +msgstr "" + +#: src/main.c:515 +#, c-format +msgid "%s: illegal option -- `-n%c'\n" +msgstr "" + +#. #### Something nicer should be printed here -- similar to the +#. pre-1.5 `--help' page. +#: src/main.c:517 src/main.c:558 src/main.c:589 +#, c-format +msgid "Try `%s --help' for more options.\n" +msgstr "" + +#: src/main.c:569 +msgid "Can't be verbose and quiet at the same time.\n" +msgstr "" + +#: src/main.c:575 +msgid "Can't timestamp and not clobber old files at the same time.\n" +msgstr "" + +#. No URL specified. +#: src/main.c:584 +#, c-format +msgid "%s: missing URL\n" +msgstr "" + +#: src/main.c:668 +#, c-format +msgid "No URLs found in %s.\n" +msgstr "" + +#: src/main.c:677 +#, c-format +msgid "" +"\n" +"FINISHED --%s--\n" +"Downloaded: %s bytes in %d files\n" +msgstr "" + +#: src/main.c:682 +#, c-format +msgid "Download quota (%s bytes) EXCEEDED!\n" +msgstr "" + #. Please note that the double `%' in `%%s' is intentional, because #. redirect_output passes tmp through printf. -#: src/main.c:736 +#: src/main.c:709 msgid "%s received, redirecting output to `%%s'.\n" msgstr "" -#: src/mswindows.c:136 src/mswindows.c:143 -msgid "wget: Couldn't find usable socket driver.\n" -msgstr "" - -#: src/mswindows.c:192 +#: src/mswindows.c:118 #, c-format msgid "" "\n" @@ -799,19 +802,34 @@ "You may stop Wget by pressing CTRL+ALT+DELETE.\n" msgstr "" -#: src/mswindows.c:256 +#. parent, no error +#: src/mswindows.c:135 src/utils.c:265 +msgid "Continuing in background.\n" +msgstr "" + +#: src/mswindows.c:137 src/utils.c:267 +#, c-format +msgid "Output will be written to `%s'.\n" +msgstr "" + +#: src/mswindows.c:227 #, c-format msgid "Starting WinHelp %s\n" msgstr "" +#: src/mswindows.c:254 src/mswindows.c:262 +#, c-format +msgid "%s: Couldn't find usable socket driver.\n" +msgstr "" + #: src/netrc.c:330 #, c-format -msgid "wget: %s:%d: warning: \"%s\" token appears before any machine name\n" +msgid "%s: %s:%d: warning: \"%s\" token appears before any machine name\n" msgstr "" #: src/netrc.c:362 #, c-format -msgid "wget: %s:%d: unknown token \"%s\"\n" +msgid "%s: %s:%d: unknown token \"%s\"\n" msgstr "" #: src/netrc.c:426 @@ -871,44 +889,44 @@ "\n" msgstr "" -#: src/url.c:906 +#: src/url.c:940 #, c-format msgid "Error (%s): Link %s without a base provided.\n" msgstr "" -#: src/url.c:920 +#: src/url.c:954 #, c-format msgid "Error (%s): Base %s relative, without referer URL.\n" msgstr "" -#: src/url.c:1329 +#: src/url.c:1363 #, c-format msgid "Converting %s... " msgstr "" -#: src/url.c:1334 src/url.c:1345 +#: src/url.c:1368 src/url.c:1379 #, c-format msgid "Cannot convert links in %s: %s\n" msgstr "" -#: src/utils.c:70 +#: src/utils.c:68 #, c-format -msgid "wget: %s: Not enough memory.\n" +msgid "%s: %s: Not enough memory.\n" msgstr "" -#: src/utils.c:203 +#: src/utils.c:200 msgid "Unknown/unsupported protocol" msgstr "" -#: src/utils.c:206 +#: src/utils.c:203 msgid "Invalid port specification" msgstr "" -#: src/utils.c:209 +#: src/utils.c:206 msgid "Invalid host name" msgstr "" -#: src/utils.c:397 +#: src/utils.c:427 #, c-format msgid "Failed to unlink symlink `%s': %s\n" msgstr "" diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/ChangeLog wget-1.5.1/src/ChangeLog --- wget-1.5.0/src/ChangeLog Mon Apr 20 02:05:33 1998 +++ wget-1.5.1/src/ChangeLog Tue May 5 10:34:05 1998 @@ -1,3 +1,80 @@ +1998-05-05 Hrvoje Niksic + + * version.c: Wget 1.5.1 is released. + +1998-05-05 Hrvoje Niksic + + * http.c (parse_http_status_line): Avoid `minor' and `major' + names. + +1998-05-02 Hrvoje Niksic + + * utils.c (mkdirhier): Renamed to make_directory. + +1998-05-01 Hrvoje Niksic + + * mswindows.c (fork_to_background): Define under Windows. + + * utils.c (fork_to_background): New function. + + * html.c (htmlfindurl): Removed rerdundant casts. + +1998-05-01 Douglas E. Wegscheid + + * mswindows.c (ws_mypath): Cache the path. + +1998-04-30 Douglas E. Wegscheid + + * ftp.h: Prefix enum ftype members with FT_. + + * ftp-ls.c, ftp.c, html.h: Adjust accordingly. + + * mswindows.h: Use stat under Borland, _stat under MSVC. + +1998-04-28 Hrvoje Niksic + + * http.c (known_authentication_scheme_p): New function. + (gethttp): Handle authorization more correctly. + + * ftp-basic.h: Removed. + + * cmpt.h: Removed. + + * utils.c: Include before ; needed under SunOS + with gcc 2.8. + (numdigit): Use `while' loop. + + * http.c (create_authorization_line): Detect authentication + schemes case-insensitively. + + * http.c (extract_header_attr): Use strdupdelim(). + (digest_authentication_encode): Move declaration of local + variables to smaller scope. + (digest_authentication_encode): Reset REALM, OPAQUE and NONCE. + (create_authorization_line): Detect authentication schemes + case-insensitively. + + * utils.c (touch): Constify. + + * http.c (gethttp): Report a nicer error when no data is received. + + * rbuf.h (RBUF_READCHAR): Ditto. + + * ftp-basic.c (ftp_response): Use sizeof. + +1998-04-27 Hrvoje Niksic + + * retr.c (print_percentage): EXPECTED is long, not int. + (print_percentage): Use floating-point arithmetic to avoid + overflow with large files' sizes multiplied with 100. + +1998-04-27 Gregor Hoffleit + + * config.h.in: Added pid_t stub. + + * sysdep.h (S_ISREG): Moved here from mswindows.h (NeXT doesn't + define it). + 1998-04-20 Hrvoje Niksic * version.c: Wget 1.5.0 is released. @@ -911,7 +988,7 @@ * http.c (gethttp): Protect a stray fprintf(). * init.c (settime): New function. - (setval): Treat WAIT specially, allowing suffices like `m' for + (setval): Treat WAIT specially, allowing suffixes like `m' for minutes, etc. 1998-01-21 Hrvoje Niksic @@ -1761,7 +1838,7 @@ 1996-11-08 Hrvoje Niksic - * url.c (url_filename): Do not create numbered suffices if + * url.c (url_filename): Do not create numbered suffixes if opt.noclobber -- would bug out on -nc. 1996-11-07 Hrvoje Niksic diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/Makefile.in wget-1.5.1/src/Makefile.in --- wget-1.5.0/src/Makefile.in Wed Apr 1 17:52:27 1998 +++ wget-1.5.1/src/Makefile.in Tue Apr 28 15:46:54 1998 @@ -132,26 +132,26 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -cmpt$o: config.h wget.h sysdep.h options.h cmpt.h -connect$o: config.h wget.h sysdep.h options.h cmpt.h connect.h host.h -fnmatch$o: config.h wget.h sysdep.h options.h cmpt.h fnmatch.h -ftp-basic$o: config.h wget.h sysdep.h options.h cmpt.h utils.h rbuf.h ftp-basic.h connect.h host.h -ftp-ls$o: config.h wget.h sysdep.h options.h cmpt.h utils.h ftp.h rbuf.h -ftp-opie$o: config.h wget.h sysdep.h options.h cmpt.h md5.h -ftp$o: config.h wget.h sysdep.h options.h cmpt.h utils.h url.h rbuf.h retr.h ftp.h ftp-basic.h html.h connect.h host.h fnmatch.h netrc.h -getopt$o: wget.h sysdep.h options.h cmpt.h -headers$o: config.h wget.h sysdep.h options.h cmpt.h connect.h rbuf.h headers.h -host$o: config.h wget.h sysdep.h options.h cmpt.h utils.h host.h url.h -html$o: config.h wget.h sysdep.h options.h cmpt.h url.h utils.h ftp.h rbuf.h html.h -http$o: config.h wget.h sysdep.h options.h cmpt.h utils.h url.h host.h rbuf.h retr.h headers.h connect.h fnmatch.h netrc.h -init$o: config.h wget.h sysdep.h options.h cmpt.h utils.h init.h host.h recur.h netrc.h -log$o: config.h wget.h sysdep.h options.h cmpt.h utils.h -main$o: config.h wget.h sysdep.h options.h cmpt.h utils.h getopt.h init.h retr.h rbuf.h recur.h host.h -md5$o: wget.h sysdep.h options.h cmpt.h md5.h -mswindows$o: config.h winsock.h wget.h sysdep.h options.h cmpt.h url.h -netrc$o: wget.h sysdep.h options.h cmpt.h utils.h netrc.h init.h -rbuf$o: config.h wget.h sysdep.h options.h cmpt.h rbuf.h connect.h -recur$o: config.h wget.h sysdep.h options.h cmpt.h url.h recur.h utils.h retr.h rbuf.h ftp.h fnmatch.h host.h -retr$o: config.h wget.h sysdep.h options.h cmpt.h utils.h retr.h rbuf.h url.h recur.h ftp.h host.h connect.h -url$o: config.h wget.h sysdep.h options.h cmpt.h utils.h url.h host.h html.h -utils$o: config.h wget.h sysdep.h options.h cmpt.h utils.h fnmatch.h +cmpt$o: config.h wget.h sysdep.h options.h +connect$o: config.h wget.h sysdep.h options.h connect.h host.h +fnmatch$o: config.h wget.h sysdep.h options.h fnmatch.h +ftp-basic$o: config.h wget.h sysdep.h options.h utils.h rbuf.h connect.h host.h +ftp-ls$o: config.h wget.h sysdep.h options.h utils.h ftp.h rbuf.h +ftp-opie$o: config.h wget.h sysdep.h options.h md5.h +ftp$o: config.h wget.h sysdep.h options.h utils.h url.h rbuf.h retr.h ftp.h html.h connect.h host.h fnmatch.h netrc.h +getopt$o: wget.h sysdep.h options.h +headers$o: config.h wget.h sysdep.h options.h connect.h rbuf.h headers.h +host$o: config.h wget.h sysdep.h options.h utils.h host.h url.h +html$o: config.h wget.h sysdep.h options.h url.h utils.h ftp.h rbuf.h html.h +http$o: config.h wget.h sysdep.h options.h utils.h url.h host.h rbuf.h retr.h headers.h connect.h fnmatch.h netrc.h +init$o: config.h wget.h sysdep.h options.h utils.h init.h host.h recur.h netrc.h +log$o: config.h wget.h sysdep.h options.h utils.h +main$o: config.h wget.h sysdep.h options.h utils.h getopt.h init.h retr.h rbuf.h recur.h host.h +md5$o: wget.h sysdep.h options.h md5.h +mswindows$o: config.h winsock.h wget.h sysdep.h options.h url.h +netrc$o: wget.h sysdep.h options.h utils.h netrc.h init.h +rbuf$o: config.h wget.h sysdep.h options.h rbuf.h connect.h +recur$o: config.h wget.h sysdep.h options.h url.h recur.h utils.h retr.h rbuf.h ftp.h fnmatch.h host.h +retr$o: config.h wget.h sysdep.h options.h utils.h retr.h rbuf.h url.h recur.h ftp.h host.h connect.h +url$o: config.h wget.h sysdep.h options.h utils.h url.h host.h html.h +utils$o: config.h wget.h sysdep.h options.h utils.h fnmatch.h diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/cmpt.c wget-1.5.1/src/cmpt.c --- wget-1.5.0/src/cmpt.c Sat Mar 7 21:56:37 1998 +++ wget-1.5.1/src/cmpt.c Fri May 1 19:44:46 1998 @@ -35,7 +35,6 @@ #include #include "wget.h" -#include "cmpt.h" #ifndef HAVE_STRERROR /* A strerror() clone, for systems that don't have it. */ @@ -479,7 +478,7 @@ #ifdef weak_alias weak_alias (mktime, timelocal) #endif -#endif /* HAVE_MKTIME */ +#endif /* not HAVE_MKTIME */ #ifndef HAVE_STRPTIME diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/cmpt.h wget-1.5.1/src/cmpt.h --- wget-1.5.0/src/cmpt.h Sat Jan 31 03:34:50 1998 +++ wget-1.5.1/src/cmpt.h Thu Jan 1 02:00:00 1970 @@ -1,39 +0,0 @@ -/* Declarations for cmpt. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - -This file is part of Wget. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifndef CMPT_H -#define CMPT_H - -#ifndef HAVE_STRERROR -char *strerror (); -#endif -#ifndef HAVE_STRCASECMP -int strcasecmp (); -#endif -#ifndef HAVE_STRNCASECMP -int strncasecmp (); -#endif -#ifndef HAVE_STRSTR -char *strstr (); -#endif -#ifndef HAVE_STRPTIME -char *strptime (); -#endif - -#endif /* CMPT_H */ diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/config.h.in wget-1.5.1/src/config.h.in --- wget-1.5.0/src/config.h.in Sat Apr 4 23:14:42 1998 +++ wget-1.5.1/src/config.h.in Mon Apr 27 21:15:21 1998 @@ -53,6 +53,9 @@ /* Define to `unsigned' if doesn't define. */ #undef size_t +/* Define to `int' if doesn't define. */ +#undef pid_t + /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/fnmatch.c wget-1.5.1/src/fnmatch.c --- wget-1.5.0/src/fnmatch.c Mon Mar 30 19:50:41 1998 +++ wget-1.5.1/src/fnmatch.c Fri May 1 19:30:26 1998 @@ -17,9 +17,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* NOTE: Some Un*xes have their own fnmatch() -- yet, it has been - reported to have bugs in many implementations. Thus I chose never - to use it; this version (from GNU Bash) is used unconditionally. */ +/* NOTE: Some Un*xes have their own fnmatch() -- yet, they are + reportedly unreliable and buggy. Thus I chose never to use it; + this version (from GNU Bash) is used unconditionally. */ #include @@ -191,7 +191,7 @@ /* Return non-zero if S contains globbing wildcards (`*', `?', `[' or `]'). */ int -has_wildcards (const char *s) +has_wildcards_p (const char *s) { for (; *s; s++) if (*s == '*' || *s == '?' || *s == '[' || *s == ']') diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/fnmatch.h wget-1.5.1/src/fnmatch.h --- wget-1.5.0/src/fnmatch.h Tue Feb 17 06:10:28 1998 +++ wget-1.5.1/src/fnmatch.h Sat May 2 05:03:09 1998 @@ -30,6 +30,6 @@ #define FNM_NOMATCH 1 int fnmatch PARAMS ((const char *, const char *, int)); -int has_wildcards PARAMS ((const char *)); +int has_wildcards_p PARAMS ((const char *)); #endif /* MTCH_H */ diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/ftp-basic.c wget-1.5.1/src/ftp-basic.c --- wget-1.5.0/src/ftp-basic.c Sat Apr 18 19:50:37 1998 +++ wget-1.5.1/src/ftp-basic.c Fri May 1 19:37:01 1998 @@ -1,5 +1,5 @@ /* Basic FTP routines. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of Wget. @@ -39,7 +39,6 @@ #include "wget.h" #include "utils.h" #include "rbuf.h" -#include "ftp-basic.h" #include "connect.h" #include "host.h" @@ -50,9 +49,6 @@ extern int h_errno; #endif -/* The initial size of line read by FTP. */ -#define FTP_DYNAMIC_LINE_BUFFER 40 - char ftp_last_respline[128]; @@ -64,7 +60,7 @@ ftp_response (struct rbuf *rbuf, char **line) { int i; - int bufsize = FTP_DYNAMIC_LINE_BUFFER; + int bufsize = 40; *line = (char *)xmalloc (bufsize); do @@ -97,8 +93,8 @@ } while (!(i >= 3 && ISDIGIT (**line) && ISDIGIT ((*line)[1]) && ISDIGIT ((*line)[2]) && (*line)[3] == ' ')); - strncpy (ftp_last_respline, *line, 128); - ftp_last_respline[127] = '\0'; + strncpy (ftp_last_respline, *line, sizeof (ftp_last_respline)); + ftp_last_respline[sizeof (ftp_last_respline) - 1] = '\0'; return FTPOK; } diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/ftp-basic.h wget-1.5.1/src/ftp-basic.h --- wget-1.5.0/src/ftp-basic.h Sun Feb 1 21:46:59 1998 +++ wget-1.5.1/src/ftp-basic.h Thu Jan 1 02:00:00 1970 @@ -1,34 +0,0 @@ -/* Declarations for basic FTP support. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - -This file is part of Wget. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - - -#ifndef FTP_BASIC_H -#define FTP_BASIC_H - -uerr_t ftp_response PARAMS ((struct rbuf *, char **)); -uerr_t ftp_login PARAMS ((struct rbuf *, const char *, const char *)); -uerr_t ftp_port PARAMS ((struct rbuf *)); -uerr_t ftp_pasv PARAMS ((struct rbuf *, unsigned char *)); -uerr_t ftp_type PARAMS ((struct rbuf *, int)); -uerr_t ftp_cwd PARAMS ((struct rbuf *, const char *)); -uerr_t ftp_retr PARAMS ((struct rbuf *, const char *)); -uerr_t ftp_rest PARAMS ((struct rbuf *, long)); -uerr_t ftp_list PARAMS ((struct rbuf *, const char *)); - -#endif /* FTP_BASIC_H */ diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/ftp-ls.c wget-1.5.1/src/ftp-ls.c --- wget-1.5.0/src/ftp-ls.c Sun Apr 5 05:21:12 1998 +++ wget-1.5.1/src/ftp-ls.c Thu Apr 30 19:57:22 1998 @@ -120,19 +120,19 @@ switch (*tok) { case '-': - cur.type = PLAINFILE; + cur.type = FT_PLAINFILE; DEBUGP (("PLAINFILE; ")); break; case 'd': - cur.type = DIRECTORY; + cur.type = FT_DIRECTORY; DEBUGP (("DIRECTORY; ")); break; case 'l': - cur.type = SYMLINK; + cur.type = FT_SYMLINK; DEBUGP (("SYMLINK; ")); break; default: - cur.type = UNKNOWN; + cur.type = FT_UNKNOWN; DEBUGP (("UNKOWN; ")); break; } @@ -247,7 +247,7 @@ tok[fnlen] = ' '; /* If the file is a symbolic link, it should have a ` -> ' somewhere. */ - if (cur.type == SYMLINK) + if (cur.type == FT_SYMLINK) { p = strstr (tok, " -> "); if (!p) @@ -283,17 +283,17 @@ memcpy (cur.name, tok, fnlen + 1); if (fnlen) { - if (cur.type == DIRECTORY && cur.name[fnlen - 1] == '/') + if (cur.type == FT_DIRECTORY && cur.name[fnlen - 1] == '/') { cur.name[fnlen - 1] = '\0'; DEBUGP (("trailing `/' on dir.\n")); } - else if (cur.type == SYMLINK && cur.name[fnlen - 1] == '@') + else if (cur.type == FT_SYMLINK && cur.name[fnlen - 1] == '@') { cur.name[fnlen - 1] = '\0'; DEBUGP (("trailing `@' on link.\n")); } - else if (cur.type == PLAINFILE + else if (cur.type == FT_PLAINFILE && (cur.perms & 0111) && cur.name[fnlen - 1] == '*') { @@ -309,7 +309,7 @@ abort (); } /* while */ - if (!cur.name || (cur.type == SYMLINK && !cur.linkto)) + if (!cur.name || (cur.type == FT_SYMLINK && !cur.linkto)) error = 1; DEBUGP (("\n")); diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/ftp-opie.c wget-1.5.1/src/ftp-opie.c --- wget-1.5.0/src/ftp-opie.c Wed Apr 1 06:05:50 1998 +++ wget-1.5.1/src/ftp-opie.c Fri May 1 19:37:18 1998 @@ -1,5 +1,5 @@ /* Opie (s/key) support for FTP. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1998 Free Software Foundation, Inc. This file is part of Wget. diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/ftp.c wget-1.5.1/src/ftp.c --- wget-1.5.0/src/ftp.c Wed Apr 8 13:47:12 1998 +++ wget-1.5.1/src/ftp.c Fri May 1 19:30:47 1998 @@ -39,7 +39,6 @@ #include "rbuf.h" #include "retr.h" #include "ftp.h" -#include "ftp-basic.h" #include "html.h" #include "connect.h" #include "host.h" @@ -56,7 +55,7 @@ /* File where the "ls -al" listing will be saved. */ #define LIST_FILENAME ".listing" -extern char ftp_last_respline[128]; +extern char ftp_last_respline[]; /* Look for regexp "( *[0-9]+ *byte" (literal parenthesis) anywhere in the string S, and return the number converted to long, if found, 0 @@ -1082,7 +1081,7 @@ err = RETROK; dlthis = 1; - if (opt.timestamping && f->type == PLAINFILE) + if (opt.timestamping && f->type == FT_PLAINFILE) { struct stat st; if (!stat (u->local, &st)) @@ -1102,10 +1101,10 @@ The sizes do not match (local %ld), retrieving.\n"), local_size); } } - } /* opt.timestamping && f->type == PLAINFILE */ + } /* opt.timestamping && f->type == FT_PLAINFILE */ switch (f->type) { - case SYMLINK: + case FT_SYMLINK: /* If opt.retr_symlinks is defined, we treat symlinks as if they were normal files. There is currently no way to distinguish whether they might be directories, and @@ -1160,17 +1159,17 @@ err = ftp_loop_internal (u, f, con); } /* opt.retr_symlinks */ break; - case DIRECTORY: + case FT_DIRECTORY: if (!opt.recursive) logprintf (LOG_NOTQUIET, _("Skipping directory `%s'.\n"), f->name); break; - case PLAINFILE: + case FT_PLAINFILE: /* Call the retrieve loop. */ if (dlthis) err = ftp_loop_internal (u, f, con); break; - case UNKNOWN: + case FT_UNKNOWN: logprintf (LOG_NOTQUIET, _("%s: unknown/unsupported file type.\n"), f->name); break; @@ -1180,7 +1179,7 @@ are not to be stamped because it sets the stamp on the original. :( */ if (!opt.dfp - && !(f->type == SYMLINK && !opt.retr_symlinks) + && !(f->type == FT_SYMLINK && !opt.retr_symlinks) && f->tstamp != -1 && file_exists_p (u->local)) { @@ -1230,7 +1229,7 @@ if (opt.quota && opt.downloaded > opt.quota) break; - if (f->type != DIRECTORY) + if (f->type != FT_DIRECTORY) continue; odir = u->dir; len = 1 + strlen (u->dir) + 1 + strlen (f->name) + 1; @@ -1289,7 +1288,7 @@ while (f) { - if (f->type != DIRECTORY && !acceptable (f->name)) + if (f->type != FT_DIRECTORY && !acceptable (f->name)) { logprintf (LOG_VERBOSE, _("Rejecting `%s'.\n"), f->name); f = delelement (f, &start); @@ -1413,7 +1412,7 @@ } else { - int wild = has_wildcards (u->file); + int wild = has_wildcards_p (u->file); if ((opt.ftp_glob && wild) || opt.recursive || opt.timestamping) { /* ftp_retrieve_glob is a catch-all function that gets called diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/ftp.h wget-1.5.1/src/ftp.h --- wget-1.5.0/src/ftp.h Wed Apr 1 05:52:16 1998 +++ wget-1.5.1/src/ftp.h Tue May 5 09:04:58 1998 @@ -21,16 +21,27 @@ /* Need it for struct rbuf. */ #include "rbuf.h" +uerr_t ftp_response PARAMS ((struct rbuf *, char **)); +uerr_t ftp_login PARAMS ((struct rbuf *, const char *, const char *)); +uerr_t ftp_port PARAMS ((struct rbuf *)); +uerr_t ftp_pasv PARAMS ((struct rbuf *, unsigned char *)); +uerr_t ftp_type PARAMS ((struct rbuf *, int)); +uerr_t ftp_cwd PARAMS ((struct rbuf *, const char *)); +uerr_t ftp_retr PARAMS ((struct rbuf *, const char *)); +uerr_t ftp_rest PARAMS ((struct rbuf *, long)); +uerr_t ftp_list PARAMS ((struct rbuf *, const char *)); + struct urlinfo; /* File types. */ enum ftype { - PLAINFILE, - DIRECTORY, - SYMLINK, - UNKNOWN + FT_PLAINFILE, + FT_DIRECTORY, + FT_SYMLINK, + FT_UNKNOWN }; + /* Globbing (used by ftp_retrieve_glob). */ enum diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/headers.c wget-1.5.1/src/headers.c --- wget-1.5.0/src/headers.c Wed Apr 8 06:52:10 1998 +++ wget-1.5.1/src/headers.c Fri May 1 19:37:47 1998 @@ -1,5 +1,5 @@ /* Generic support for headers. - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1997, 1998 Free Software Foundation, Inc. This file is part of Wget. @@ -54,8 +54,6 @@ see. */ -#define HEADER_DYNAMIC_LINE_BUFFER 40 - /* Get a header from read-buffer RBUF and return it in *HDR. As defined in RFC2068 and elsewhere, a header can be folded into @@ -73,7 +71,7 @@ header_get (struct rbuf *rbuf, char **hdr, enum header_get_flags flags) { int i; - int bufsize = HEADER_DYNAMIC_LINE_BUFFER; + int bufsize = 80; *hdr = (char *)xmalloc (bufsize); for (i = 0; 1; i++) diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/headers.h wget-1.5.1/src/headers.h --- wget-1.5.0/src/headers.h Wed Apr 8 06:50:06 1998 +++ wget-1.5.1/src/headers.h Tue Apr 28 07:09:38 1998 @@ -21,7 +21,8 @@ HG_OK, HG_ERROR, HG_EOF }; -enum header_get_flags { HG_NO_CONTINUATIONS }; +enum header_get_flags { HG_NONE = 0, + HG_NO_CONTINUATIONS = 0x2 }; int header_get PARAMS ((struct rbuf *, char **, enum header_get_flags)); int header_process PARAMS ((const char *, const char *, diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/host.c wget-1.5.1/src/host.c --- wget-1.5.0/src/host.c Fri Apr 10 15:37:18 1998 +++ wget-1.5.1/src/host.c Tue Apr 28 23:42:40 1998 @@ -60,7 +60,7 @@ inclusion, e.g. "fly.cc.fer.hr". */ char *hostname; /* Host's "real" name, i.e. its IP address, written out in ASCII - form of N.N.N.N, e.g. "161.53.70.140". */ + form of N.N.N.N, e.g. "161.53.70.130". */ char *realname; /* More than one HOSTNAME can correspond to the same REALNAME. For our purposes, the canonical name of the host is its HOSTNAME when @@ -76,7 +76,7 @@ const char *, int)); /* The same as gethostbyname, but supports internet addresses of the - form N.N.N.N */ + form `N.N.N.N'. */ struct hostent * ngethostbyname (const char *name) { @@ -229,7 +229,7 @@ return beg; } -/* Determine the "real" name of the host, as viewed by Wget. If host +/* Determine the "real" name of HOST, as perceived by Wget. If HOST is referenced by more than one name, "real" name is considered to be the first one encountered in the past. @@ -429,7 +429,8 @@ if (!pwd_cuserid (userid)) { - logputs (LOG_ALWAYS, _("wget: Cannot determine user-id.\n")); + logprintf (LOG_ALWAYS, _("%s: Cannot determine user-id.\n"), + exec_name); exit (1); } #ifdef MY_HOST @@ -440,8 +441,8 @@ struct utsname ubuf; if (uname (&ubuf) < 0) { - logprintf (LOG_ALWAYS, _("wget: Warning: uname failed: %s\n"), - strerror (errno)); + logprintf (LOG_ALWAYS, _("%s: Warning: uname failed: %s\n"), + exec_name, strerror (errno)); fqdn = ""; goto giveup; } @@ -452,7 +453,8 @@ host = alloca (256); if (gethostname (host, 256) < 0) { - logputs (LOG_ALWAYS, _("wget: Warning: gethostname failed\n")); + logprintf (LOG_ALWAYS, _("%s: Warning: gethostname failed\n"), + exec_name); fqdn = ""; goto giveup; } @@ -479,8 +481,9 @@ struct hostent *hp = gethostbyname (host); if (!hp || !hp->h_addr_list) { - logputs (LOG_ALWAYS, _("\ -wget: Warning: cannot determine local IP address.\n")); + logprintf (LOG_ALWAYS, _("\ +%s: Warning: cannot determine local IP address.\n"), + exec_name); fqdn = ""; goto giveup; } @@ -492,15 +495,17 @@ hp = gethostbyaddr (tmpstore, hp->h_length, hp->h_addrtype); if (!hp || !hp->h_name) { - logputs (LOG_ALWAYS, _("\ -wget: Warning: cannot reverse-lookup local IP address.\n")); + logprintf (LOG_ALWAYS, _("\ +%s: Warning: cannot reverse-lookup local IP address.\n"), + exec_name); fqdn = ""; goto giveup; } if (!strchr (hp->h_name, '.')) { - logputs (LOG_ALWAYS, _("\ -wget: Warning: reverse-lookup of local address did not yield FQDN!\n")); + logprintf (LOG_ALWAYS, _("\ +%s: Warning: reverse-lookup of local address did not yield FQDN!\n"), + exec_name); fqdn = ""; goto giveup; } diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/html.c wget-1.5.1/src/html.c --- wget-1.5.0/src/html.c Sun Apr 5 05:21:10 1998 +++ wget-1.5.1/src/html.c Fri May 1 18:49:58 1998 @@ -17,6 +17,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* #### "Simple" is an understatement. Calling this parser + "brain-damaged" would hit much closer to truth. Rewrite it! */ + #include #include @@ -57,11 +60,11 @@ return 0; } -/* The following function parses an HTML buffer buf, of size bufsize - searching for tags. When a tag is encountered, the routine will - extract its components. If "src", "href" or "background" are - found, their address is returned, and so is the length of the - string. Returns NULL if no URL is found. */ +/* Parse BUF (a buffer of BUFSIZE characters) searching for HTML tags + describing URLs to follow. When a tag is encountered, extract its + components (as described by html_allow[] array), and return the + address and the length of the string. Return NULL if no URL is + found. */ const char * htmlfindurl (const char *buf, int bufsize, int *size, int init) { @@ -133,7 +136,7 @@ ++buf, --bufsize; continue; } - s->tag = strdupdelim ((char *)p, (char *)buf); + s->tag = strdupdelim (p, buf); if (*buf == '>') { free (s->tag); @@ -144,7 +147,7 @@ } else /* s->at_value */ { - /* Reset the at_value flag. */ + /* Reset AT_VALUE. */ s->at_value = 0; /* If in quotes, just skip out of them and continue living. */ if (s->in_quote) @@ -194,7 +197,7 @@ if (!bufsize || *buf == '>') break; /* Construct the attribute. */ - s->attr = strdupdelim ((char *)p, (char *)buf); + s->attr = strdupdelim (p, buf); /* Now we must skip the spaces to find '='. */ if (*buf != '=') { @@ -261,7 +264,7 @@ if (!strcasecmp (s->tag, "base") && !strcasecmp (s->attr, "href")) { FREE_MAYBE (s->base); - s->base = strdupdelim ((char *)p, (char *)buf); + s->base = strdupdelim (p, buf); } else if (!strcasecmp (s->tag, "meta") && !strcasecmp (s->attr, "content")) { @@ -282,18 +285,18 @@ if (*p == ';') { for (p++, *size -= 1; *size && ISSPACE (*p); p++, *size -= 1) ; - if (!strncasecmp ((char *)p, "URL=", 4)) + if (!strncasecmp (p, "URL=", 4)) { p += 4, *size -= 4; s->at_value = 1; - return (char *)p; + return p; } } } else { s->at_value = 1; - return (char *)p; + return p; } } /* Exit from quote. */ @@ -397,11 +400,6 @@ ftp_index (const char *file, struct urlinfo *u, struct fileinfo *f) { FILE *fp; - struct tm *ptm; - static char *months[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; char *upwd; char *htclfile; /* HTML-clean file name */ @@ -441,7 +439,13 @@ fprintf (fp, " "); if (f->tstamp != -1) { - ptm = localtime ((time_t *)&f->tstamp); + /* #### Should we translate the months? */ + static char *months[] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }; + struct tm *ptm = localtime ((time_t *)&f->tstamp); + fprintf (fp, "%d %s %02d ", ptm->tm_year + 1900, months[ptm->tm_mon], ptm->tm_mday); if (ptm->tm_hour) @@ -453,13 +457,13 @@ fprintf (fp, _("time unknown ")); switch (f->type) { - case PLAINFILE: + case FT_PLAINFILE: fprintf (fp, _("File ")); break; - case DIRECTORY: + case FT_DIRECTORY: fprintf (fp, _("Directory ")); break; - case SYMLINK: + case FT_SYMLINK: fprintf (fp, _("Link ")); break; default: @@ -474,15 +478,15 @@ if (*u->dir) putc ('/', fp); fprintf (fp, "%s", htclfile); - if (f->type == DIRECTORY) + if (f->type == FT_DIRECTORY) putc ('/', fp); fprintf (fp, "\">%s", htclfile); - if (f->type == DIRECTORY) + if (f->type == FT_DIRECTORY) putc ('/', fp); fprintf (fp, " "); - if (f->type == PLAINFILE) + if (f->type == FT_PLAINFILE) fprintf (fp, _(" (%s bytes)"), legible (f->size)); - else if (f->type == SYMLINK) + else if (f->type == FT_SYMLINK) fprintf (fp, "-> %s", f->linkto ? f->linkto : "(nil)"); putc ('\n', fp); free (htclfile); diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/http.c wget-1.5.1/src/http.c --- wget-1.5.0/src/http.c Mon Apr 20 01:52:23 1998 +++ wget-1.5.1/src/http.c Tue May 5 10:33:24 1998 @@ -102,56 +102,63 @@ HTTP-Version SP Status-Code SP Reason-Phrase The function returns the status-code, or -1 if the status line is - malformed. The pointer to reason-phrase is returned in rp. */ + malformed. The pointer to reason-phrase is returned in RP. */ static int -parse_http_status_line (const char *hdr, const char **rp) +parse_http_status_line (const char *line, const char **reason_phrase_ptr) { + /* (the variables must not be named `major' and `minor', because + that breaks build on SunOS4.) */ int mjr, mnr; /* HTTP major and minor version */ int statcode; /* HTTP status code */ const char *p; - *rp = NULL; + *reason_phrase_ptr = NULL; + /* The standard format of HTTP-Version is: `HTTP/X.Y', where X is major version, and Y is minor version. */ - if (strncmp (hdr, "HTTP/", 5) != 0) + if (strncmp (line, "HTTP/", 5) != 0) return -1; - hdr += 5; - p = hdr; - for (mjr = 0; ISDIGIT (*hdr); hdr++) - mjr = 10 * mjr + (*hdr - '0'); - if (*hdr != '.' || p == hdr) + line += 5; + + /* Calculate major HTTP version. */ + p = line; + for (mjr = 0; ISDIGIT (*line); line++) + mjr = 10 * mjr + (*line - '0'); + if (*line != '.' || p == line) return -1; - ++hdr; - p = hdr; - for (mnr = 0; ISDIGIT (*hdr); hdr++) - mnr = 10 * mnr + (*hdr - '0'); - if (*hdr != ' ' || p == hdr) + ++line; + + /* Calculate minor HTTP version. */ + p = line; + for (mnr = 0; ISDIGIT (*line); line++) + mnr = 10 * mnr + (*line - '0'); + if (*line != ' ' || p == line) return -1; /* Wget will accept only 1.0 and higher HTTP-versions. The value of minor version can be safely ignored. */ if (mjr < 1) return -1; - /* Skip the space. */ - ++hdr; - if (!(ISDIGIT (*hdr) && ISDIGIT (hdr[1]) && ISDIGIT (hdr[2]))) + ++line; + + /* Calculate status code. */ + if (!(ISDIGIT (*line) && ISDIGIT (line[1]) && ISDIGIT (line[2]))) return -1; - statcode = 100 * (*hdr - '0') + 10 * (hdr[1] - '0') + (hdr[2] - '0'); - /* RFC2068 requires SPC here, even if there is no reason-phrase. - As some servers/CGI are (incorrectly) setup to drop the SPC, - we'll be liberal and allow the status line to end here. - - "...be liberal in what you accept" Bah! Maybe automatically - sending a mail to admin with Cc: to alt.sysadmin.recovery would - be a better idea. */ - if (hdr[3] != ' ') + statcode = 100 * (*line - '0') + 10 * (line[1] - '0') + (line[2] - '0'); + + /* Set up the reason phrase pointer. */ + line += 3; + /* RFC2068 requires SPC here, but we allow the string to finish + here, in case no reason-phrase is present. */ + if (*line != ' ') { - if (!hdr[3]) - *rp = hdr + 3; + if (!*line) + *reason_phrase_ptr = line; else return -1; } else - *rp = hdr + 4; + *reason_phrase_ptr = line + 1; + return statcode; } @@ -267,6 +274,7 @@ const char *)); static char *basic_authentication_encode PARAMS ((const char *, const char *, const char *)); +static int known_authentication_scheme_p PARAMS ((const char *)); static time_t http_atotm PARAMS ((char *)); @@ -429,8 +437,8 @@ proxy_user = u->user; proxy_passwd = u->passwd; } - /* #### This is junky. Can't the proxy also require, say, - `Digest' authentication? */ + /* #### This is junky. Can't the proxy request, say, `Digest' + authentication? */ if (proxy_user && proxy_passwd) proxyauth = basic_authentication_encode (proxy_user, proxy_passwd, "Proxy-Authorization"); @@ -477,7 +485,7 @@ CLOSE (sock); return WRITEFAILED; } - logprintf (LOG_VERBOSE, _("%s request sent, fetching headers... "), + logprintf (LOG_VERBOSE, _("%s request sent, awaiting response... "), u->proxy ? "Proxy" : "HTTP"); contlen = contrange = -1; type = NULL; @@ -500,7 +508,7 @@ /* Get the header. */ status = header_get (&rbuf, &hdr, /* Disallow continuations for status line. */ - (hcount == 1 ? HG_NO_CONTINUATIONS : 0)); + (hcount == 1 ? HG_NO_CONTINUATIONS : HG_NONE)); /* Check for errors. */ if (status == HG_EOF && *hdr) @@ -549,8 +557,8 @@ all_headers[all_length] = '\0'; } - /* Print the header if necessary. */ - if (opt.server_response) + /* Print the header if requested. */ + if (opt.server_response && hcount != 1) logprintf (LOG_VERBOSE, "\n%d %s", hcount, hdr); /* Check for status line. */ @@ -563,7 +571,13 @@ /* Store the descriptive response. */ if (statcode == -1) /* malformed response */ { - hs->error = xstrdup (_("Malformed status line")); + /* A common reason for "malformed response" error is the + case when no data was actually received. Handle this + special case. */ + if (!*hdr) + hs->error = xstrdup (_("No data received")); + else + hs->error = xstrdup (_("Malformed status line")); free (hdr); break; } @@ -571,6 +585,14 @@ hs->error = xstrdup (_("(no description)")); else hs->error = xstrdup (error); + + if ((statcode != -1) +#ifdef DEBUG + && !opt.debug +#endif + ) + logprintf (LOG_VERBOSE, "%d %s", statcode, error); + goto done_header; } @@ -628,25 +650,37 @@ } done_header: free (hdr); - } /* while (1) */ + } - /* 20x responses are counted among successful by default. */ - if (H_20X (statcode)) - *dt |= RETROKF; + logputs (LOG_VERBOSE, "\n"); if ((statcode == HTTP_STATUS_UNAUTHORIZED) - && authenticate_h - && !auth_tried_already) + && authenticate_h) { - /* Authorization is required. If we have tried it already, then - there is not point retrying it. */ + /* Authorization is required. */ FREE_MAYBE (type); type = NULL; FREEHSTAT (*hs); - CLOSE(sock); - - auth_tried_already = 1; - goto again; + CLOSE (sock); + if (auth_tried_already) + { + /* If we have tried it already, then there is not point + retrying it. */ + logputs (LOG_NOTQUIET, _("Authorization failed.\n")); + free (authenticate_h); + return AUTHFAILED; + } + else if (!known_authentication_scheme_p (authenticate_h)) + { + free (authenticate_h); + logputs (LOG_NOTQUIET, _("Unknown authentication scheme.\n")); + return AUTHFAILED; + } + else + { + auth_tried_already = 1; + goto again; + } } /* We do not need this anymore. */ if (authenticate_h) @@ -655,6 +689,10 @@ authenticate_h = NULL; } + /* 20x responses are counted among successful by default. */ + if (H_20X (statcode)) + *dt |= RETROKF; + if (type && !strncasecmp (type, TEXTHTML_S, strlen (TEXTHTML_S))) *dt |= TEXTHTML; else @@ -684,9 +722,6 @@ content-range will be ignored. */ } hs->contlen = contlen; - if (!opt.server_response) - logputs (LOG_VERBOSE, _("done.")); - logputs (LOG_VERBOSE, "\n"); /* Return if redirected. */ if (H_REDIRECTED (statcode) || statcode == HTTP_STATUS_MULTIPLE_CHOICES) @@ -805,10 +840,13 @@ struct stat st; *newloc = NULL; - /* Warn on wildcard usage in HTTP. Don't use has_wildcards because - it would also warn on '?', and we don't what that because of CGI. */ + + /* Warn on (likely bogus) wildcard usage in HTTP. Don't use + has_wildcards_p because it would also warn on `?', and we that + shows up in CGI paths a *lot*. */ if (strchr (u->url, '*')) logputs (LOG_VERBOSE, _("Warning: wildcards not supported in HTTP.\n")); + /* Determine the local filename. */ if (!u->local) u->local = url_filename (u->proxy ? u->proxy : u); @@ -826,6 +864,8 @@ File `%s' already there, will not retrieve.\n"), u->local); /* If the file is there, we suppose it's retrieved OK. */ *dt |= RETROKF; + + /* #### Bogusness alert. */ /* If its suffix is "html" or (yuck!) "htm", we suppose it's text/html, a harmless lie. */ if (((suf = suffix (u->local)) != NULL) @@ -918,7 +958,7 @@ printwhat (count, opt.ntry); continue; break; - case HOSTERR: case CONREFUSED: case PROXERR: + case HOSTERR: case CONREFUSED: case PROXERR: case AUTHFAILED: /* Fatal errors just return from the function. */ FREEHSTAT (hstat); return err; @@ -1008,13 +1048,14 @@ } FREEHSTAT (hstat); continue; - } /* use_ts */ + } if (!opt.dfp - && (tmr != (time_t) (-1)) && !opt.spider && - ((hstat.len == hstat.contlen) || - ((hstat.res == 0) && - ((hstat.contlen == -1) || - (hstat.len >= hstat.contlen && !opt.kill_longer))))) + && (tmr != (time_t) (-1)) + && !opt.spider + && ((hstat.len == hstat.contlen) || + ((hstat.res == 0) && + ((hstat.contlen == -1) || + (hstat.len >= hstat.contlen && !opt.kill_longer))))) { touch (u->local, tmr); } @@ -1065,7 +1106,7 @@ opt.downloaded += hstat.len; return RETROK; } - else if (hstat.len < hstat.contlen) /* Meaning we lost the + else if (hstat.len < hstat.contlen) /* meaning we lost the connection too soon */ { logprintf (LOG_VERBOSE, @@ -1074,7 +1115,7 @@ printwhat (count, opt.ntry); continue; } - else if (!opt.kill_longer) /* Meaning we got more than expected */ + else if (!opt.kill_longer) /* meaning we got more than expected */ { logprintf (LOG_VERBOSE, _("%s (%s) - `%s' saved [%ld/%ld])\n\n"), @@ -1086,7 +1127,7 @@ opt.downloaded += hstat.len; return RETROK; } - else /* The same, but not accepted */ + else /* the same, but not accepted */ { logprintf (LOG_VERBOSE, _("%s (%s) - Connection closed at byte %ld/%ld. "), @@ -1095,7 +1136,7 @@ continue; } } - else /* Now hstat.res can only be -1 */ + else /* now hstat.res can only be -1 */ { if (hstat.contlen == -1) { @@ -1105,7 +1146,7 @@ printwhat (count, opt.ntry); continue; } - else /* hstat.res == -1 and contlen is given */ + else /* hstat.res == -1 and contlen is given */ { logprintf (LOG_VERBOSE, _("%s (%s) - Read error at byte %ld/%ld (%s). "), @@ -1178,7 +1219,7 @@ schemes fail. Needless to say, what we *really* need here is something like - Marcus Hennecke's atotm(), which is very slack, fast, to-the-point, + Marcus Hennecke's atotm(), which is forgiving, fast, to-the-point, and does not use strptime(). atotm() is to be found in the sources of `phttpd', a little-known HTTP server written by Peter Erikson. */ static time_t @@ -1246,7 +1287,7 @@ to STORE. STORE will be 0-terminated, and must point to a writable buffer of at least 1+BASE64_LENGTH(length) bytes. */ static void -base64_encode_line (const char *s, char *store, int length) +base64_encode (const char *s, char *store, int length) { /* Conversion table. */ static char tbl[64] = { @@ -1294,7 +1335,7 @@ t1 = (char *)alloca (len1 + 1); sprintf (t1, "%s:%s", user, passwd); t2 = (char *)alloca (1 + len2); - base64_encode_line (t1, t2, len1); + base64_encode (t1, t2, len1); res = (char *)malloc (len2 + 11 + strlen (header)); sprintf (res, "%s: Basic %s\r\n", header, t2); @@ -1326,33 +1367,30 @@ if (!*++cp) return -1; cp += skip_lws (cp); - if (*cp != '"') + if (*cp != '\"') return -1; if (!*++cp) return -1; - for (ep = cp; *ep && *ep != '"'; ep++) + for (ep = cp; *ep && *ep != '\"'; ep++) ; if (!*ep) return -1; FREE_MAYBE (*ret); - *ret = (char *)xmalloc (ep - cp + 1); - memcpy (*ret, cp, ep - cp); - (*ret)[ep - cp] = 0; + *ret = strdupdelim (cp, ep); return ep - au + 1; } else return 0; } -/* Dump the hexadecimal representation of HASH to BUF. HASH should be - an array of 16 bytes containing the hash keys, and BUF should be a - buffer of 33 writable characters (32 for hex digits plus one for - zero termination). */ - /* Response value needs to be in lowercase, so we cannot use HEXD2ASC from url.h. See RFC 2069 2.1.2 for the syntax of response-digest. */ #define HEXD2asc(x) (((x) < 10) ? ((x) + '0') : ((x) - 10 + 'a')) +/* Dump the hexadecimal representation of HASH to BUF. HASH should be + an array of 16 bytes containing the hash keys, and BUF should be a + buffer of 33 writable characters (32 for hex digits plus one for + zero termination). */ static void dump_hash (unsigned char *buf, const unsigned char *hash) { @@ -1366,39 +1404,36 @@ *buf = '\0'; } -/* Create the authorization request header contents for the `Digest' - scheme. See RFC2069 section 2.1.2. */ +/* Take the line apart to find the challenge, and compose a digest + authorization header. See RFC2069 section 2.1.2. */ char * digest_authentication_encode (const char *au, const char *user, const char *passwd, const char *method, const char *path) { - /* Take the line apart to find the challenge, and compose a digest - authorization header. */ - static char *realm = NULL; - static char *opaque = NULL; - static char *nonce = NULL; - const char *cp; - int skip, q; + static char *realm, *opaque, *nonce; static struct { const char *name; char **variable; } options[] = { { "realm", &realm }, { "opaque", &opaque }, - { "nonce", &nonce }, - { 0, 0 } + { "nonce", &nonce } }; char *res; - cp = au + 6; /* skip over `Digest' */ - while (*cp) + realm = opaque = nonce = NULL; + + au += 6; /* skip over `Digest' */ + while (*au) { - cp += skip_lws (cp); - for (q = 0; options[q].name; q++) + int i; + + au += skip_lws (au); + for (i = 0; i < ARRAY_SIZE (options); i++) { - skip = extract_header_attr (cp, options[q].name, - options[q].variable); + int skip = extract_header_attr (au, options[i].name, + options[i].variable); if (skip < 0) { FREE_MAYBE (realm); @@ -1408,31 +1443,31 @@ } else if (skip) { - cp += skip; + au += skip; break; } } - if (options[q].name == 0) + if (i == ARRAY_SIZE (options)) { - while (*cp && *cp != '=') - cp++; - if (*cp && *++cp) + while (*au && *au != '=') + au++; + if (*au && *++au) { - cp += skip_lws (cp); - if (*cp == '"') + au += skip_lws (au); + if (*au == '\"') { - cp++; - while (*cp && *cp != '"') - cp++; - if (*cp) - cp++; + au++; + while (*au && *au != '\"') + au++; + if (*au) + au++; } } } - while (*cp && *cp != ',') - cp++; - if (*cp) - cp++; + while (*au && *au != ',') + au++; + if (*au) + au++; } if (!realm || !nonce || !user || !passwd || !path || !method) { @@ -1449,6 +1484,7 @@ unsigned char a1buf[MD5_HASHLEN * 2 + 1], a2buf[MD5_HASHLEN * 2 + 1]; unsigned char response_digest[MD5_HASHLEN * 2 + 1]; + /* A1BUF = H(user ":" realm ":" password) */ md5_init_ctx (&ctx); md5_process_bytes (user, strlen (user), &ctx); md5_process_bytes (":", 1, &ctx); @@ -1458,6 +1494,7 @@ md5_finish_ctx (&ctx, hash); dump_hash (a1buf, hash); + /* A2BUF = H(method ":" path) */ md5_init_ctx (&ctx); md5_process_bytes (method, strlen (method), &ctx); md5_process_bytes (":", 1, &ctx); @@ -1465,6 +1502,7 @@ md5_finish_ctx (&ctx, hash); dump_hash (a2buf, hash); + /* RESPONSE_DIGEST = H(A1BUF ":" nonce ":" A2BUF) */ md5_init_ctx (&ctx); md5_process_bytes (a1buf, MD5_HASHLEN * 2, &ctx); md5_process_bytes (":", 1, &ctx); @@ -1475,20 +1513,22 @@ dump_hash (response_digest, hash); res = (char*) xmalloc (strlen (user) + + strlen (user) + strlen (realm) - + strlen (path) + strlen (nonce) + + strlen (path) + + 2 * MD5_HASHLEN /*strlen (response_digest)*/ + (opaque ? strlen (opaque) : 0) - /* #### 512? Yuck! --hniksic */ - + 512); + + 128); sprintf (res, "Authorization: Digest \ username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\"", user, realm, nonce, path, response_digest); if (opaque) { - strcat (res, ", opaque=\""); - strcat (res, opaque); - strcat (res, "\""); + char *p = res + strlen (res); + strcat (p, ", opaque=\""); + strcat (p, opaque); + strcat (p, "\""); } strcat (res, "\r\n"); } @@ -1496,6 +1536,20 @@ } #endif /* USE_DIGEST */ + +#define HACK_O_MATIC(line, string_constant) \ + (!strncasecmp (line, string_constant, sizeof (string_constant) - 1) \ + && (ISSPACE (line[sizeof (string_constant) - 1]) \ + || !line[sizeof (string_constant) - 1])) + +static int +known_authentication_scheme_p (const char *au) +{ + return HACK_O_MATIC (au, "Basic") || HACK_O_MATIC (au, "Digest"); +} + +#undef HACK_O_MATIC + /* Create the HTTP authorization request header. When the `WWW-Authenticate' response header is seen, according to the authorization scheme specified in that header (`Basic' and `Digest' @@ -1508,10 +1562,10 @@ { char *wwwauth = NULL; - if (strncmp (au, "Basic", 5) == 0) + if (!strncasecmp (au, "Basic", 5)) wwwauth = basic_authentication_encode (user, passwd, "Authorization"); #ifdef USE_DIGEST - else if (strncmp (au, "Digest", 6) == 0) + else if (!strncasecmp (au, "Digest", 6)) wwwauth = digest_authentication_encode (au, user, passwd, method, path); #endif /* USE_DIGEST */ return wwwauth; diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/init.c wget-1.5.1/src/init.c --- wget-1.5.0/src/init.c Wed Apr 8 03:52:34 1998 +++ wget-1.5.1/src/init.c Fri May 1 19:43:20 1998 @@ -1,5 +1,5 @@ /* Reading/parsing the initialization file. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of Wget. @@ -257,7 +257,7 @@ { if (!file_exists_p (env)) { - fprintf (stderr, "wget: %s: %s.\n", file, strerror (errno)); + fprintf (stderr, "%s: %s: %s.\n", exec_name, file, strerror (errno)); exit (1); } return xstrdup (env); @@ -276,7 +276,7 @@ directory where `wget.exe' resides, and `wget.ini' will be used as file name. SYSTEM_WGETRC should not be defined under WINDOWS. - It is not so trivial as I assumed, cause on 95 argv[0] is full + It is not as trivial as I assumed, because on 95 argv[0] is full path, but on NT you get what you typed in command line. --dbudor */ home = ws_mypath (); if (home) @@ -308,8 +308,8 @@ fp = fopen (file, "rb"); if (!fp) { - fprintf (stderr, _("wget: Cannot read %s (%s).\n"), file, - strerror (errno)); + fprintf (stderr, _("%s: Cannot read %s (%s).\n"), exec_name, + file, strerror (errno)); return; } /* Reset line number. */ @@ -329,12 +329,14 @@ if (status == 1) { if (!setval (com, val)) - fprintf (stderr, _("wget: Error in %s at line %d.\n"), file, ln); + fprintf (stderr, _("%s: Error in %s at line %d.\n"), exec_name, + file, ln); free (com); free (val); } else if (status == 0) - fprintf (stderr, _("wget: Error in %s at line %d.\n"), file, ln); + fprintf (stderr, _("%s: Error in %s at line %d.\n"), exec_name, + file, ln); ++ln; } fclose (fp); @@ -365,8 +367,8 @@ if (!strcmp (file, SYSTEM_WGETRC)) { fprintf (stderr, _("\ -wget: Warning: Both system and user wgetrc point to `%s'.\n"), - file); +%s: Warning: Both system and user wgetrc point to `%s'.\n"), + exec_name, file); } else #endif @@ -455,8 +457,8 @@ { /* #### Should I just abort()? */ #ifdef DEBUG - fprintf (stderr, _("wget: Unknown command `%s', value `%s'.\n"), - com, val); + fprintf (stderr, _("%s: BUG: unknown command `%s', value `%s'.\n"), + exec_name, com, val); #endif return 0; } @@ -482,7 +484,8 @@ bool_value = 0; else { - fprintf (stderr, _("wget: %s: Please specify on or off.\n"), com); + fprintf (stderr, _("%s: %s: Please specify on or off.\n"), + exec_name, com); return 0; } @@ -499,7 +502,8 @@ if (num == -1) { - fprintf (stderr, _("wget: %s: Invalid specification `%s'.\n"), com, val); + fprintf (stderr, _("%s: %s: Invalid specification `%s'.\n"), + exec_name, com, val); return 0; } *(int *)closure = num; @@ -755,8 +759,8 @@ } else { - fprintf (stderr, _("wget: %s: Invalid specification `%s'.\n"), - com, val); + fprintf (stderr, _("%s: %s: Invalid specification `%s'.\n"), + exec_name, com, val); return 0; } return 1; @@ -777,8 +781,8 @@ if (!check_user_specified_header (val)) { - fprintf (stderr, _("wget: %s: Invalid specification `%s'.\n"), - com, val); + fprintf (stderr, _("%s: %s: Invalid specification `%s'.\n"), + exec_name, com, val); return 0; } i = opt.user_header ? strlen (opt.user_header) : 0; @@ -850,8 +854,8 @@ junk to the server. */ if (!*val || strchr (val, '\n')) { - fprintf (stderr, _("wget: %s: Invalid specification `%s'.\n"), - com, val); + fprintf (stderr, _("%s: %s: Invalid specification `%s'.\n"), + exec_name, com, val); return 0; } opt.useragent = xstrdup (val); diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/log.c wget-1.5.1/src/log.c --- wget-1.5.0/src/log.c Sun Apr 5 06:02:33 1998 +++ wget-1.5.1/src/log.c Tue Apr 28 23:39:32 1998 @@ -305,7 +305,7 @@ logfp = fopen (logfile, "w"); if (!logfp) { - printf ("wget: %s: %s\n", logfile, strerror (errno)); + printf ("%s: %s: %s\n", exec_name, logfile, strerror (errno)); /* `stdin' is magic to not print anything. */ logfp = stdin; } diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/main.c wget-1.5.1/src/main.c --- wget-1.5.0/src/main.c Mon Apr 20 01:01:00 1998 +++ wget-1.5.1/src/main.c Fri May 1 18:56:08 1998 @@ -40,7 +40,7 @@ #endif /* HAVE_LOCALE_H */ #endif /* HAVE_NLS */ -#define OPTIONS_DEFINED_HERE /* For options.h */ +#define OPTIONS_DEFINED_HERE /* for options.h */ #include "wget.h" #include "utils.h" @@ -50,9 +50,7 @@ #include "recur.h" #include "host.h" -#ifdef WINDOWS -# define PATH_SEPARATOR '\\' -#else +#ifndef PATH_SEPARATOR # define PATH_SEPARATOR '/' #endif @@ -69,14 +67,130 @@ void log_close PARAMS ((void)); void redirect_output PARAMS ((const char *)); -static void i18n_initialize PARAMS ((void)); -static void print_usage PARAMS ((void)); -static void print_help PARAMS ((void)); static RETSIGTYPE redirect_output_signal PARAMS ((int)); -static const char *exec_name; - +const char *exec_name; + +/* Initialize I18N. The initialization amounts to invoking + setlocale(), bindtextdomain() and textdomain(). + Does nothing if NLS is disabled or missing. */ +static void +i18n_initialize (void) +{ + /* If HAVE_NLS is defined, assume the existence of the three + functions invoked here. */ +#ifdef HAVE_NLS + /* Set the current locale. */ + /* Here we use LC_MESSAGES instead of LC_ALL, for two reasons. + First, message catalogs are all of I18N Wget uses anyway. + Second, setting LC_ALL has a dangerous potential of messing + things up. For example, when in a foreign locale, Solaris + strptime() fails to handle international dates correctly, which + makes http_atotm() malfunction. */ + setlocale (LC_MESSAGES, ""); + /* Set the text message domain. */ + bindtextdomain ("wget", LOCALEDIR); + textdomain ("wget"); +#endif /* HAVE_NLS */ +} + +/* Print the usage message. */ +static void +print_usage (void) +{ + printf (_("Usage: %s [OPTION]... [URL]...\n"), exec_name); +} +/* Print the help message, describing all the available options. If + you add an option, be sure to update this list. */ +static void +print_help (void) +{ + printf (_("GNU Wget %s, a non-interactive network retriever.\n"), + version_string); + print_usage (); + /* Had to split this in parts, so the #@@#%# Ultrix compiler and cpp + don't bitch. Also, it makes translation much easier. */ + printf ("%s%s%s%s%s%s%s%s%s%s", _("\ +\n\ +Mandatory arguments to long options are mandatory for short options too.\n\ +\n"), _("\ +Startup:\n\ + -V, --version display the version of Wget and exit.\n\ + -h, --help print this help.\n\ + -b, --background go to background after startup.\n\ + -e, --execute=COMMAND execute a `.wgetrc\' command.\n\ +\n"), _("\ +Logging and input file:\n\ + -o, --output-file=FILE log messages to FILE.\n\ + -a, --append-output=FILE append messages to FILE.\n\ + -d, --debug print debug output.\n\ + -q, --quiet quiet (no output).\n\ + -v, --verbose be verbose (this is the default).\n\ + -nv, --non-verbose turn off verboseness, without being quiet.\n\ + -i, --input-file=FILE read URL-s from file.\n\ + -F, --force-html treat input file as HTML.\n\ +\n"), _("\ +Download:\n\ + -t, --tries=NUMBER set number of retries to NUMBER (0 unlimits).\n\ + -O --output-document=FILE write documents to FILE.\n\ + -nc, --no-clobber don\'t clobber existing files.\n\ + -c, --continue restart getting an existing file.\n\ + --dot-style=STYLE set retrieval display style.\n\ + -N, --timestamping don\'t retrieve files if older than local.\n\ + -S, --server-response print server response.\n\ + --spider don\'t download anything.\n\ + -T, --timeout=SECONDS set the read timeout to SECONDS.\n\ + -w, --wait=SECONDS wait SECONDS between retrievals.\n\ + -Y, --proxy=on/off turn proxy on or off.\n\ + -Q, --quota=NUMBER set retrieval quota to NUMBER.\n\ +\n"), _("\ +Directories:\n\ + -nd --no-directories don\'t create directories.\n\ + -x, --force-directories force creation of directories.\n\ + -nH, --no-host-directories don\'t create host directories.\n\ + -P, --directory-prefix=PREFIX save files to PREFIX/...\n\ + --cut-dirs=NUMBER ignore NUMBER remote directory components.\n\ +\n"), _("\ +HTTP options:\n\ + --http-user=USER set http user to USER.\n\ + --http-passwd=PASS set http password to PASS.\n\ + -C, --cache=on/off (dis)allow server-cached data (normally allowed).\n\ + --ignore-length ignore `Content-Length\' header field.\n\ + --header=STRING insert STRING among the headers.\n\ + --proxy-user=USER set USER as proxy username.\n\ + --proxy-passwd=PASS set PASS as proxy password.\n\ + -s, --save-headers save the HTTP headers to file.\n\ + -U, --user-agent=AGENT identify as AGENT instead of Wget/VERSION.\n\ +\n"), _("\ +FTP options:\n\ + --retr-symlinks retrieve FTP symbolic links.\n\ + -g, --glob=on/off turn file name globbing on or off.\n\ + --passive-ftp use the \"passive\" transfer mode.\n\ +\n"), _("\ +Recursive retrieval:\n\ + -r, --recursive recursive web-suck -- use with care!.\n\ + -l, --level=NUMBER maximum recursion depth (0 to unlimit).\n\ + --delete-after delete downloaded files.\n\ + -k, --convert-links convert non-relative links to relative.\n\ + -m, --mirror turn on options suitable for mirroring.\n\ + -nr, --dont-remove-listing don\'t remove `.listing\' files.\n\ +\n"), _("\ +Recursive accept/reject:\n\ + -A, --accept=LIST list of accepted extensions.\n\ + -R, --reject=LIST list of rejected extensions.\n\ + -D, --domains=LIST list of accepted domains.\n\ + --exclude-domains=LIST comma-separated list of rejected domains.\n\ + -L, --relative follow relative links only.\n\ + --follow-ftp follow FTP links from HTML documents.\n\ + -H, --span-hosts go to foreign hosts when recursive.\n\ + -I, --include-directories=LIST list of allowed directories.\n\ + -X, --exclude-directories=LIST list of excluded directories.\n\ + -nh, --no-host-lookup don\'t DNS-lookup hosts.\n\ + -np, --no-parent don\'t ascend to the parent directory.\n\ +\n"), _("Mail bug reports and suggestions to .\n")); +} + int main (int argc, char *const *argv) { @@ -230,7 +344,8 @@ #ifdef DEBUG setval ("debug", "on"); #else /* not DEBUG */ - fprintf (stderr, _("wget: debug support not compiled in.\n")); + fprintf (stderr, _("%s: debug support not compiled in.\n"), + exec_name); #endif /* not DEBUG */ break; case 'E': @@ -347,7 +462,8 @@ } else { - fprintf (stderr, _("wget: %s: invalid command\n"), optarg); + fprintf (stderr, _("%s: %s: invalid command\n"), exec_name, + optarg); exit (1); } free (com); @@ -367,38 +483,42 @@ setval ("reclevel", optarg); break; case 'n': - /* #### The n? options are utter crock! */ - for (i = 0; i < strlen (optarg); i++) - switch (optarg[i]) - { - case 'v': - setval ("verbose", "off"); - break; - case 'h': - setval ("simplehostcheck", "on"); - break; - case 'H': - setval ("addhostdir", "off"); - break; - case 'd': - setval ("dirstruct", "off"); - break; - case 'c': - setval ("noclobber", "on"); - break; - case 'r': - setval ("removelisting", "off"); - break; - case 'p': - setval ("noparent", "on"); - break; - default: - printf (_("wget: illegal option -- `-n%c'\n"), optarg[i]); - print_usage (); - printf (_("Try `%s --help\' for more options.\n"), exec_name); - exit (1); - } - break; + { + /* #### The n? options are utter crock! */ + char *p; + + for (p = optarg; *p; p++) + switch (*p) + { + case 'v': + setval ("verbose", "off"); + break; + case 'h': + setval ("simplehostcheck", "on"); + break; + case 'H': + setval ("addhostdir", "off"); + break; + case 'd': + setval ("dirstruct", "off"); + break; + case 'c': + setval ("noclobber", "on"); + break; + case 'r': + setval ("removelisting", "off"); + break; + case 'p': + setval ("noparent", "on"); + break; + default: + printf (_("%s: illegal option -- `-n%c'\n"), exec_name, *p); + print_usage (); + printf (_("Try `%s --help\' for more options.\n"), exec_name); + exit (1); + } + break; + } case 'O': setval ("outputdocument", optarg); break; @@ -461,7 +581,7 @@ if (!nurl && !opt.input_filename) { /* No URL specified. */ - printf (_("wget: missing URL\n")); + printf (_("%s: missing URL\n"), exec_name); print_usage (); printf ("\n"); /* #### Something nicer should be printed here -- similar to the @@ -470,37 +590,8 @@ exit (1); } -#ifndef WINDOWS /* Actually, similar functionality is already - implemented in windows_main_junk(). Merge it with - this! */ - /* Go to background. */ if (opt.background) - { - pid_t pid; - /* Whether we arrange our own version of opt.lfilename here. */ - int changedp = 0; - - if (!opt.lfilename) - { - opt.lfilename = unique_name (DEFAULT_LOGFILE); - changedp = 1; - } - pid = fork (); - if (pid < 0) - { - perror ("fork"); - exit (1); - } - else if (pid != 0) - { - /* Parent */ - printf (_("Continuing in background.\n")); - if (changedp) - printf (_("Output will be written to `%s'.\n"), opt.lfilename); - exit (0); - } - } -#endif /* not WINDOWS */ + fork_to_background (); /* Allocate basic pointer. */ url = ALLOCA_ARRAY (char *, nurl + 1); @@ -601,126 +692,6 @@ return 0; else return 1; -} - -/* Initialize I18N. The initialization amounts to invoking - setlocale(), bindtextdomain() and textdomain(). - Does nothing if NLS is disabled or missing. */ -static void -i18n_initialize (void) -{ - /* If HAVE_NLS is defined, assume the existence of the three - functions invoked here. */ -#ifdef HAVE_NLS - /* Set the current locale. */ - /* Here we use LC_MESSAGES instead of LC_ALL, for two reasons. - First, message catalogs are all of I18N Wget uses anyway. - Second, setting LC_ALL has a dangerous potential of messing - things up. For example, when in a foreign locale, Solaris - strptime() fails to handle international dates correctly, which - makes http_atotm() malfunction. */ - setlocale (LC_MESSAGES, ""); - /* Set the text message domain. */ - bindtextdomain ("wget", LOCALEDIR); - textdomain ("wget"); -#endif /* HAVE_NLS */ -} - -/* Print the usage message. */ -static void -print_usage (void) -{ - printf (_("Usage: %s [OPTION]... [URL]...\n"), exec_name); -} - -/* Print the help message, describing all the available options. If - you add an option, be sure to update this list. */ -static void -print_help (void) -{ - printf (_("GNU Wget %s, a non-interactive network retriever.\n"), - version_string); - print_usage (); - /* Had to split this in parts, so the #@@#%# Ultrix compiler and cpp - don't bitch. Also, it makes translation much easier. */ - printf ("%s%s%s%s%s%s%s%s%s%s", _("\ -\n\ -Mandatory arguments to long options are mandatory for short options too.\n\ -\n"), _("\ -Startup:\n\ - -V, --version display the version of Wget and exit.\n\ - -h, --help print this help.\n\ - -b, --background go to background after startup.\n\ - -e, --execute=COMMAND execute a `.wgetrc\' command.\n\ -\n"), _("\ -Logging and input file:\n\ - -o, --output-file=FILE log messages to FILE.\n\ - -a, --append-output=FILE append messages to FILE.\n\ - -d, --debug print debug output.\n\ - -q, --quiet quiet (no output).\n\ - -v, --verbose be verbose (this is the default).\n\ - -nv, --non-verbose turn off verboseness, without being quiet.\n\ - -i, --input-file=FILE read URL-s from file.\n\ - -F, --force-html treat input file as HTML.\n\ -\n"), _("\ -Download:\n\ - -t, --tries=NUMBER set number of retries to NUMBER (0 unlimits).\n\ - -O --output-document=FILE write documents to FILE.\n\ - -nc, --no-clobber don\'t clobber existing files.\n\ - -c, --continue restart getting an existing file.\n\ - --dot-style=STYLE set retrieval display style.\n\ - -N, --timestamping don\'t retrieve files if older than local.\n\ - -S, --server-response print server response.\n\ - --spider don\'t download anything.\n\ - -T, --timeout=SECONDS set the read timeout to SECONDS.\n\ - -w, --wait=SECONDS wait SECONDS between retrievals.\n\ - -Y, --proxy=on/off turn proxy on or off.\n\ - -Q, --quota=NUMBER set retrieval quota to NUMBER.\n\ -\n"), _("\ -Directories:\n\ - -nd --no-directories don\'t create directories.\n\ - -x, --force-directories force creation of directories.\n\ - -nH, --no-host-directories don\'t create host directories.\n\ - -P, --directory-prefix=PREFIX save files to PREFIX/...\n\ - --cut-dirs=NUMBER ignore NUMBER remote directory components.\n\ -\n"), _("\ -HTTP options:\n\ - --http-user=USER set http user to USER.\n\ - --http-passwd=PASS set http password to PASS.\n\ - -C, --cache=on/off (dis)allow server-cached data (normally allowed).\n\ - --ignore-length ignore `Content-Length\' header field.\n\ - --header=STRING insert STRING among the headers.\n\ - --proxy-user=USER set USER as proxy username.\n\ - --proxy-passwd=PASS set PASS as proxy password.\n\ - -s, --save-headers save the HTTP headers to file.\n\ - -U, --user-agent=AGENT identify as AGENT instead of Wget/VERSION.\n\ -\n"), _("\ -FTP options:\n\ - --retr-symlinks retrieve FTP symbolic links.\n\ - -g, --glob=on/off turn file name globbing on or off.\n\ - --passive-ftp use the \"passive\" transfer mode.\n\ -\n"), _("\ -Recursive retrieval:\n\ - -r, --recursive recursive web-suck -- use with care!.\n\ - -l, --level=NUMBER maximum recursion depth (0 to unlimit).\n\ - --delete-after delete downloaded files.\n\ - -k, --convert-links convert non-relative links to relative.\n\ - -m, --mirror turn on options suitable for mirroring.\n\ - -nr, --dont-remove-listing don\'t remove `.listing\' files.\n\ -\n"), _("\ -Recursive accept/reject:\n\ - -A, --accept=LIST list of accepted extensions.\n\ - -R, --reject=LIST list of rejected extensions.\n\ - -D, --domains=LIST list of accepted domains.\n\ - --exclude-domains=LIST comma-separated list of rejected domains.\n\ - -L, --relative follow relative links only.\n\ - --follow-ftp follow FTP links from HTML documents.\n\ - -H, --span-hosts go to foreign hosts when recursive.\n\ - -I, --include-directories=LIST list of allowed directories.\n\ - -X, --exclude-directories=LIST list of excluded directories.\n\ - -nh, --no-host-lookup don\'t DNS-lookup hosts.\n\ - -np, --no-parent don\'t ascend to the parent directory.\n\ -\n"), _("Mail bug reports and suggestions to .\n")); } /* Hangup signal handler. When wget receives SIGHUP or SIGUSR1, it diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/md5.c wget-1.5.1/src/md5.c --- wget-1.5.0/src/md5.c Sat Apr 4 05:47:28 1998 +++ wget-1.5.1/src/md5.c Tue Apr 28 07:12:53 1998 @@ -255,7 +255,7 @@ md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) { md5_uint32 correct_words[16]; - const md5_uint32 *words = buffer; + const md5_uint32 *words = (md5_uint32 *)buffer; size_t nwords = len / sizeof (md5_uint32); const md5_uint32 *endp = words + nwords; md5_uint32 A = ctx->A; diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/mswindows.c wget-1.5.1/src/mswindows.c --- wget-1.5.0/src/mswindows.c Sat Apr 4 03:16:31 1998 +++ wget-1.5.1/src/mswindows.c Sat May 2 05:11:25 1998 @@ -1,4 +1,4 @@ -/* mswindows.c -- Various Windows functions. +/* mswindows.c -- Windows-specific support Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of Wget. @@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* #### Someone document these functions! */ + #include #include @@ -30,35 +32,13 @@ char *argv0; -static void ws_cleanup (void); -static BOOL WINAPI ws_handler (DWORD); -static void ws_hangup (void); -static void ws_backgnd (void); -static char *read_registry (HKEY hkey, char *subkey, char *valuename, - char *buf, int *len); - -/* In log.c. */ +/* Defined in log.c. */ void redirect_output (const char *); -static char *title_buf; - -static int isNT; +static int windows_nt_p; -#if 0 /* no longer used -- see `host.c' */ -int -getdomainname (const char *buf, int len) -{ - if (!read_registry (HKEY_LOCAL_MACHINE, - "System\\CurrentControlSet\\Services\\Vxd\\MSTCP", - "Domain", buf, &len)) - { - return -1; - } - return len; -} -#endif - +/* Emulation of Unix sleep. */ unsigned int sleep (unsigned seconds) { @@ -69,25 +49,19 @@ return 0U; } -void -windows_main_junk (int *argc, char **argv, char **exec_name) +static char * +read_registry (HKEY hkey, char *subkey, char *valuename, char *buf, int *len) { - char *p; - - argv0 = argv[0]; - - /* Remove .EXE from filename if it has one. */ - *exec_name = xstrdup (*exec_name); - p = strrchr (*exec_name, '.'); - if (p) - *p = '\0'; - - /* Now we ar going to background if the last argv was `&'. */ - if (!strcmp (argv[*argc - 1], "&")) - { - ws_backgnd (); - (*argc)--; - } + HKEY result; + DWORD size = *len; + DWORD type = REG_SZ; + if (RegOpenKeyEx (hkey, subkey, NULL, KEY_READ, &result) != ERROR_SUCCESS) + return NULL; + if (RegQueryValueEx (result, valuename, NULL, &type, buf, &size) != ERROR_SUCCESS) + buf = NULL; + *len = size; + RegCloseKey (result); + return buf; } char * @@ -117,36 +91,20 @@ } void -ws_startup (void) +windows_main_junk (int *argc, char **argv, char **exec_name) { - WORD requested; - WSADATA data; - int err; - OSVERSIONINFO os; - - if (GetVersionEx (&os) == TRUE - && os.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) - isNT = 1; - - requested = MAKEWORD (1, 1); - err = WSAStartup (requested, &data); + char *p; - if (err != 0) - { - fprintf (stderr, _("wget: Couldn't find usable socket driver.\n")); - exit (1); - } + argv0 = argv[0]; - if (LOBYTE (requested) < 1 || (LOBYTE (requested) == 1 && - HIBYTE (requested) < 1)) - { - fprintf (stderr, _("wget: Couldn't find usable socket driver.\n")); - WSACleanup (); - exit (1); - } - atexit (ws_cleanup); - SetConsoleCtrlHandler (ws_handler, TRUE); + /* Remove .EXE from filename if it has one. */ + *exec_name = xstrdup (*exec_name); + p = strrchr (*exec_name, '.'); + if (p) + *p = '\0'; } + +/* Winsock stuff. */ static void ws_cleanup (void) @@ -155,10 +113,31 @@ } static void -ws_backgnd (void) +ws_hangup (void) { + redirect_output (_("\n\ +CTRL+Break received, redirecting output to `%s'.\n\ +Execution continued in background.\n\ +You may stop Wget by pressing CTRL+ALT+DELETE.\n")); +} + +void +fork_to_background (void) +{ + /* Whether we arrange our own version of opt.lfilename here. */ + int changedp = 0; + + if (!opt.lfilename) + { + opt.lfilename = unique_name (DEFAULT_LOGFILE); + changedp = 1; + } + printf (_("Continuing in background.\n")); + if (changedp) + printf (_("Output will be written to `%s'.\n"), opt.lfilename); + ws_hangup (); - if (!isNT) + if (!windows_nt_p) FreeConsole (); } @@ -167,7 +146,6 @@ { switch (dwEvent) { - #ifdef CTRLC_BACKGND case CTRL_C_EVENT: #endif @@ -186,58 +164,49 @@ return TRUE; } -static void -ws_hangup (void) -{ - redirect_output (_("\n\ -CTRL+Break received, redirecting output to `%s'.\n\ -Execution continued in background.\n\ -You may stop Wget by pressing CTRL+ALT+DELETE.\n")); -} - void ws_changetitle (char *url, int nurl) { + char *title_buf; if (!nurl) return; + title_buf = (char *)xmalloc (strlen (url) + 20); sprintf (title_buf, "Wget %s%s", url, nurl == 1 ? "" : " ..."); + /* #### What are the semantics of SetConsoleTitle? Will it free the + given memory later? */ SetConsoleTitle (title_buf); } -static char * -read_registry (HKEY hkey, char *subkey, char *valuename, char *buf, int *len) -{ - HKEY result; - DWORD size = *len; - DWORD type = REG_SZ; - if (RegOpenKeyEx (hkey, subkey, NULL, KEY_READ, &result) != ERROR_SUCCESS) - return NULL; - if (RegQueryValueEx (result, valuename, NULL, &type, buf, &size) != ERROR_SUCCESS) - buf = NULL; - *len = size; - RegCloseKey (result); - return buf; -} - char * ws_mypath (void) { + static char *wspathsave; char *buffer; int rrr; - char *ptr = strrchr (argv0, '\\'); + char *ptr; + + if (wspathsave) + { + return wspathsave; + } + ptr = strrchr (argv0, '\\'); if (ptr) { *(ptr + 1) = '\0'; - return argv0; + wspathsave = (char*) xmalloc (strlen(argv0)+1); + strcpy (wspathsave, argv0); + return wspathsave; } buffer = (char*) xmalloc (256); - if (!!(rrr = SearchPath (NULL, argv0, strchr (argv0, '.') ? NULL : ".EXE", - 256, buffer, &ptr)) - && rrr <= 256) + rrr = SearchPath (NULL, argv0, strchr (argv0, '.') ? NULL : ".EXE", + 256, buffer, &ptr); + if (rrr && rrr <= 256) { *ptr = '\0'; - return buffer; + wspathsave = (char*) xmalloc (strlen(buffer)+1); + strcpy (wspathsave, buffer); + return wspathsave; } free (buffer); return NULL; @@ -250,11 +219,51 @@ if (mypath) { - char *buf = (char *)alloca (strlen (mypath) + 1 + strlen (name) + 3 + 1); + struct stat sbuf; + char *buf = (char *)alloca (strlen (mypath) + strlen (name) + 4 + 1); sprintf (buf, "%s%s.HLP", mypath, name); -#ifdef DEBUG - printf (_("Starting WinHelp %s\n"), buf); -#endif - WinHelp (NULL, buf, HELP_INDEX, NULL); + if (stat (buf, &sbuf) == 0) + { + printf (_("Starting WinHelp %s\n"), buf); + WinHelp (NULL, buf, HELP_INDEX, NULL); + } + else + { + printf ("%s: %s\n", buf, strerror (errno)); + } + } +} + +void +ws_startup (void) +{ + WORD requested; + WSADATA data; + int err; + OSVERSIONINFO os; + + if (GetVersionEx (&os) == TRUE + && os.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) + windows_nt_p = 1; + + requested = MAKEWORD (1, 1); + err = WSAStartup (requested, &data); + + if (err != 0) + { + fprintf (stderr, _("%s: Couldn't find usable socket driver.\n"), + exec_name); + exit (1); } + + if (LOBYTE (requested) < 1 || (LOBYTE (requested) == 1 && + HIBYTE (requested) < 1)) + { + fprintf (stderr, _("%s: Couldn't find usable socket driver.\n"), + exec_name); + WSACleanup (); + exit (1); + } + atexit (ws_cleanup); + SetConsoleCtrlHandler (ws_handler, TRUE); } diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/mswindows.h wget-1.5.1/src/mswindows.h --- wget-1.5.0/src/mswindows.h Mon Apr 20 01:53:56 1998 +++ wget-1.5.1/src/mswindows.h Fri May 1 19:40:32 1998 @@ -1,5 +1,5 @@ /* Declarations for windows - Copyright (C) 1995, 1997, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1997, 1997, 1998 Free Software Foundation, Inc. This file is part of Wget. @@ -26,13 +26,21 @@ #ifndef S_ISLNK # define S_ISLNK(a) 0 #endif -#ifndef S_ISREG -# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) -#endif + +/* We have strcasecmp and strncasecmp, just under a different name. */ +#define strcasecmp stricmp +#define strncasecmp strnicmp /* No stat on Windows. */ #define lstat stat +#define PATH_SEPARATOR '\\' + +/* Microsoft says stat is _stat, Borland doesn't */ +#ifdef _MSC_VER +#define stat _stat +#endif + #define REALCLOSE(x) closesocket (x) /* read & write don't work with sockets on Windows 95. */ @@ -44,7 +52,7 @@ #define mkdir(a, b) _mkdir(a) /* bletch! */ #include -/* Declarations of various socket errors (formerly in windecl.h): */ +/* Declarations of various socket errors: */ #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/netrc.c wget-1.5.1/src/netrc.c --- wget-1.5.0/src/netrc.c Sat Mar 7 21:56:38 1998 +++ wget-1.5.1/src/netrc.c Tue Apr 28 23:41:13 1998 @@ -243,8 +243,8 @@ fp = fopen (path, "r"); if (!fp) { - fprintf (stderr, _("wget: Cannot read %s (%s).\n"), path, - strerror (errno)); + fprintf (stderr, _("%s: Cannot read %s (%s).\n"), exec_name, + path, strerror (errno)); return retval; } @@ -328,8 +328,8 @@ if (premature_token) { fprintf (stderr, _("\ -wget: %s:%d: warning: \"%s\" token appears before any machine name\n"), - path, ln, premature_token); +%s: %s:%d: warning: \"%s\" token appears before any machine name\n"), + exec_name, path, ln, premature_token); premature_token = NULL; } @@ -359,8 +359,8 @@ last_token = tok_password; else - fprintf (stderr, _("wget: %s:%d: unknown token \"%s\"\n"), - path, ln, tok); + fprintf (stderr, _("%s: %s:%d: unknown token \"%s\"\n"), + exec_name, path, ln, tok); } } diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/options.h wget-1.5.1/src/options.h --- wget-1.5.0/src/options.h Tue Mar 31 16:06:50 1998 +++ wget-1.5.1/src/options.h Tue Apr 28 23:29:40 1998 @@ -134,8 +134,6 @@ after download. */ }; -/* Hack: */ #ifndef OPTIONS_DEFINED_HERE extern struct options opt; #endif - diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/rbuf.c wget-1.5.1/src/rbuf.c --- wget-1.5.0/src/rbuf.c Sat Mar 7 21:56:38 1998 +++ wget-1.5.1/src/rbuf.c Tue Apr 28 03:13:24 1998 @@ -64,7 +64,7 @@ int res; rbuf->buffer_pos = rbuf->buffer; rbuf->buffer_left = 0; - res = iread (rbuf->fd, rbuf->buffer, INPUT_BUFFER_SIZE); + res = iread (rbuf->fd, rbuf->buffer, sizeof (rbuf->buffer)); if (res <= 0) return res; rbuf->buffer_left = res; diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/rbuf.h wget-1.5.1/src/rbuf.h --- wget-1.5.0/src/rbuf.h Mon Apr 20 01:54:28 1998 +++ wget-1.5.1/src/rbuf.h Tue Apr 28 04:42:42 1998 @@ -20,14 +20,11 @@ #ifndef RBUF_H #define RBUF_H -/* Input chunk size for buffered input (rbuf_readchar). */ -#define INPUT_BUFFER_SIZE 4096 - /* Retrieval stream */ struct rbuf { int fd; - char buffer[INPUT_BUFFER_SIZE]; /* the input buffer */ + char buffer[4096]; /* the input buffer */ char *buffer_pos; /* current position in the buffer */ size_t buffer_left; /* number of bytes left in the buffer: buffer_left = buffer_end - buffer_pos */ @@ -50,8 +47,9 @@ ? (--(rbuf)->buffer_left, \ *((char *) (store)) = *(rbuf)->buffer_pos++, 1) \ : ((rbuf)->buffer_pos = (rbuf)->buffer, \ - ((((rbuf)->internal_dont_touch_this = \ - iread ((rbuf)->fd, (rbuf)->buffer, INPUT_BUFFER_SIZE)) <= 0) \ + ((((rbuf)->internal_dont_touch_this \ + = iread ((rbuf)->fd, (rbuf)->buffer, \ + sizeof ((rbuf)->buffer))) <= 0) \ ? (rbuf)->internal_dont_touch_this \ : ((rbuf)->buffer_left = (rbuf)->internal_dont_touch_this - 1, \ *((char *) (store)) = *(rbuf)->buffer_pos++, \ diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/recur.c wget-1.5.1/src/recur.c --- wget-1.5.0/src/recur.c Sun Apr 5 05:21:09 1998 +++ wget-1.5.1/src/recur.c Fri May 1 19:32:08 1998 @@ -735,7 +735,7 @@ { /* If the string contains wildcards, we'll run it through fnmatch(). */ - if (has_wildcards (str)) + if (has_wildcards_p (str)) { /* If the string contains '/', compare with the full version. Else, compare it to base_version. */ @@ -818,4 +818,3 @@ DEBUGP (("not matched.\n")); return 1; } - diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/retr.c wget-1.5.1/src/retr.c --- wget-1.5.0/src/retr.c Sun Apr 5 05:21:08 1998 +++ wget-1.5.1/src/retr.c Fri May 1 19:39:13 1998 @@ -1,5 +1,5 @@ /* File retrieval. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of Wget. @@ -129,9 +129,9 @@ } static void -print_percentage (long bytes, int expected) +print_percentage (long bytes, long expected) { - int percentage = (int)(100 * bytes / expected); + int percentage = (int)(100.0 * bytes / expected); logprintf (LOG_VERBOSE, " [%3d%%]", percentage); } diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/sysdep.h wget-1.5.1/src/sysdep.h --- wget-1.5.0/src/sysdep.h Wed Apr 1 19:31:17 1998 +++ wget-1.5.1/src/sysdep.h Fri May 1 19:46:27 1998 @@ -57,19 +57,19 @@ /* Reportedly, stat() macros are broken on some old systems. Those systems will have to fend for themselves, as I will not introduce - new code to handle it. However, I will add code for *missing* - macros. */ + new code to handle it. -/*#ifdef __ultrix*/ + However, I will add code for *missing* macros, and the following + are missing from many systems. */ #ifndef S_ISLNK # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) #endif -/*#endif*/ -/*#ifdef NeXT*/ #ifndef S_ISDIR # define S_ISDIR(m) (((m) & (_S_IFMT)) == (_S_IFDIR)) #endif -/*#endif*/ +#ifndef S_ISREG +# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) +#endif /* Bletch! SPARC compiler doesn't define sparc (needed by arpa/nameser.h) when in -Xc mode. Luckily, it always defines @@ -114,6 +114,23 @@ #define ISDIGIT(x) isdigit ((unsigned char)(x)) #define ISXDIGIT(x) isxdigit ((unsigned char)(x)) +/* Defined in cmpt.c: */ +#ifndef HAVE_STRERROR +char *strerror (); +#endif +#ifndef HAVE_STRCASECMP +int strcasecmp (); +#endif +#ifndef HAVE_STRNCASECMP +int strncasecmp (); +#endif +#ifndef HAVE_STRSTR +char *strstr (); +#endif +#ifndef HAVE_STRPTIME +char *strptime (); +#endif + /* SunOS brain damage -- for some reason, SunOS header files fail to declare the functions below, which causes all kinds of problems (compiling errors) with pointer arithmetic and similar. @@ -131,7 +148,7 @@ char *strtok (); char *strdup (); void *memcpy (); -#endif /* __cplusplus */ +#endif /* not __cplusplus */ #endif /* sun */ #endif /* STDC_HEADERS */ diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/url.c wget-1.5.1/src/url.c --- wget-1.5.0/src/url.c Sat Apr 18 19:50:42 1998 +++ wget-1.5.1/src/url.c Mon May 4 00:53:23 1998 @@ -44,6 +44,40 @@ extern int errno; #endif +/* Default port definitions */ +#define DEFAULT_HTTP_PORT 80 +#define DEFAULT_FTP_PORT 21 + +/* URL separator (for findurl) */ +#define URL_SEPARATOR "!\"#'(),>`{}|<>" + +/* A list of unsafe characters for encoding, as per RFC1738. '@' and + ':' (not listed in RFC) were added because of user/password + encoding, and \033 for safe printing. */ + +#ifndef WINDOWS +# define URL_UNSAFE " <>\"#%{}|\\^~[]`@:\033" +#else /* WINDOWS */ +# define URL_UNSAFE " <>\"%{}|\\^[]`\033" +#endif /* WINDOWS */ + +/* If S contains unsafe characters, free it and replace it with a + version that doesn't. */ +#define URL_CLEANSE(s) do \ +{ \ + if (contains_unsafe (s)) \ + { \ + char *uc_tmp = encode_string (s); \ + free (s); \ + (s) = uc_tmp; \ + } \ +} while (0) + +/* Is a directory "."? */ +#define DOTP(x) ((*(x) == '.') && (!*(x + 1))) +/* Is a directory ".."? */ +#define DDOTP(x) ((*(x) == '.') && (*(x + 1) == '.') && (!*(x + 2))) + /* NULL-terminated list of strings to be recognized as prototypes (URL schemes). Note that recognized doesn't mean supported -- only HTTP and FTP are currently supported. @@ -424,7 +458,7 @@ if (type == URLHTTP) while (url[i] && url[i] == '/') ++i; - u->path = xmalloc (strlen (url + i) + 8); + u->path = (char *)xmalloc (strlen (url + i) + 8); strcpy (u->path, url + i); if (type == URLFTP) { @@ -617,7 +651,7 @@ } if (u->proto == URLFTP && *dir == '/') { - char *tmp = xmalloc (strlen (dir) + 3); + char *tmp = (char *)xmalloc (strlen (dir) + 3); /*sprintf (tmp, "%%2F%s", dir + 1);*/ *tmp = '%'; tmp[1] = '2'; @@ -1051,7 +1085,7 @@ unlink (t); } } - res = mkdirhier (t); + res = make_directory (t); if (res != 0) logprintf (LOG_NOTQUIET, "%s: %s", t, strerror (errno)); free (t); diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/url.h wget-1.5.1/src/url.h --- wget-1.5.0/src/url.h Sun Feb 22 05:29:41 1998 +++ wget-1.5.1/src/url.h Tue Apr 28 15:51:06 1998 @@ -20,50 +20,9 @@ #ifndef URL_H #define URL_H -/* URL separator (for findurl) */ -#define URL_SEPARATOR "!\"#'(),>`{}|<>" - -/* Default port definitions */ -#define DEFAULT_HTTP_PORT 80 -#define DEFAULT_FTP_PORT 21 - -/* ASCII char -> HEX digit */ -#define ASC2HEXD(x) (((x) >= '0' && (x) <= '9') ? \ - ((x) - '0') : (toupper(x) - 'A' + 10)) - -/* HEX digit -> ASCII char */ -#define HEXD2ASC(x) (((x) < 10) ? ((x) + '0') : ((x) - 10 + 'A')) - -/* A list of unsafe characters for encoding, as per RFC1738. '@' and - ':' (not listed in RFC) were added because of user/password - encoding, and \033 because of safe printing. */ - -#ifndef WINDOWS -# define URL_UNSAFE " <>\"#%{}|\\^~[]`@:\033" -#else -# define URL_UNSAFE " <>\"%{}|\\^[]`\033" -#endif - /* If the string contains unsafe characters, duplicate it with encode_string, otherwise just copy it with strdup. */ #define CLEANDUP(x) (contains_unsafe (x) ? encode_string (x) : xstrdup (x)) - -/* If S contains unsafe characters, free it and replace it with a - version that doesn't. */ -#define URL_CLEANSE(s) do \ -{ \ - if (contains_unsafe (s)) \ - { \ - char *uc_tmp = encode_string (s); \ - free (s); \ - (s) = uc_tmp; \ - } \ -} while (0) - -/* Is a directory "."? */ -#define DOTP(x) ((*(x) == '.') && (!*(x + 1))) -/* Is a directory ".."? */ -#define DDOTP(x) ((*(x) == '.') && (*(x + 1) == '.') && (!*(x + 2))) /* Structure containing info on a URL. */ struct urlinfo diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/utils.c wget-1.5.1/src/utils.c --- wget-1.5.0/src/utils.c Mon Apr 20 02:12:21 1998 +++ wget-1.5.1/src/utils.c Sat May 2 05:09:07 1998 @@ -1,5 +1,5 @@ /* Various functions of utilitarian nature. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of Wget. @@ -23,19 +23,17 @@ #include #ifdef HAVE_STRING_H # include -#else +#else /* not HAVE_STRING_H */ # include -#endif /* HAVE_STRING_H */ +#endif /* not HAVE_STRING_H */ #include - -#ifdef HAVE_PWD_H -# include -#endif - #include #ifdef HAVE_UNISTD_H # include #endif +#ifdef HAVE_PWD_H +# include +#endif #include #ifdef HAVE_UTIME_H # include @@ -67,7 +65,7 @@ extern int save_log_p; save_log_p = 0; - logprintf (LOG_ALWAYS, _("wget: %s: Not enough memory.\n"), s); + logprintf (LOG_ALWAYS, _("%s: %s: Not enough memory.\n"), exec_name, s); exit (1); } @@ -112,12 +110,12 @@ memfatal ("strdup"); memcpy (s1, s, l + 1); return s1; -#else /* not HAVE_STRDUP */ +#else /* HAVE_STRDUP */ char *s1 = strdup (s); if (!s1) memfatal ("strdup"); return s1; -#endif /* not HAVE_STRDUP */ +#endif /* HAVE_STRDUP */ } /* Copy the string formed by two pointers (one on the beginning, other @@ -127,7 +125,6 @@ strdupdelim (const char *beg, const char *end) { char *res = (char *)xmalloc (end - beg + 1); - memcpy (res, beg, end - beg); res[end - beg] = '\0'; return res; @@ -215,6 +212,9 @@ } } +/* The Windows versions of the following two functions are defined in + mswindows.c. */ + /* A cuserid() immitation using getpwuid(), to avoid hassling with utmp. Besides, not all systems have cuesrid(). Under Windows, it is defined in mswindows.c. @@ -239,7 +239,37 @@ else return pwd->pw_name; } -#endif /* WINDOWS */ + +void +fork_to_background (void) +{ + pid_t pid; + /* Whether we arrange our own version of opt.lfilename here. */ + int changedp = 0; + + if (!opt.lfilename) + { + opt.lfilename = unique_name (DEFAULT_LOGFILE); + changedp = 1; + } + pid = fork (); + if (pid < 0) + { + /* parent, error */ + perror ("fork"); + exit (1); + } + else if (pid != 0) + { + /* parent, no error */ + printf (_("Continuing in background.\n")); + if (changedp) + printf (_("Output will be written to `%s'.\n"), opt.lfilename); + exit (0); + } + /* child: keep running */ +} +#endif /* not WINDOWS */ /* Canonicalize PATH, and return a new path. The new path differs from PATH in that: @@ -249,8 +279,8 @@ Non-leading `../'s and trailing `..'s are handled by removing portions of the path. - E.g. "a/b/c/./../d/.." will yield "a/b". This function has been - taken from GNU Bash. + E.g. "a/b/c/./../d/.." will yield "a/b". This function originates + from GNU Bash. Changes by hniksic: Always use '/' as stub_char. @@ -367,7 +397,7 @@ /* "Touch" FILE, i.e. make its atime and mtime equal to the time specified with TM. */ void -touch (char *file, time_t tm) +touch (const char *file, time_t tm) { #ifdef HAVE_STRUCT_UTIMBUF struct utimbuf times; @@ -444,6 +474,7 @@ } else filename = xstrdup (fileprefix); + if (!file_exists_p (filename)) return filename; else @@ -453,15 +484,15 @@ } } -/* Return a unique file name, based on FILEPREFIX. */ +/* Return a unique file name, based on PREFIX. */ char * -unique_name (const char *fileprefix) +unique_name (const char *prefix) { char *file = NULL; int count = 0; while (!file) - file = unique_name_1 (fileprefix, count++); + file = unique_name_1 (prefix, count++); return file; } @@ -472,7 +503,7 @@ The behaviour of this function should be identical to the behaviour of `mkdir -p' on systems where mkdir supports the `-p' option. */ int -mkdirhier (const char *directory) +make_directory (const char *directory) { int i, status, quit; char *dir; @@ -502,7 +533,7 @@ break; else dir[i] = '/'; - } /* for */ + } return 0; } @@ -550,14 +581,14 @@ char **x; for (x = strlist; *x; x++) - if (has_wildcards (*x)) + if (has_wildcards_p (*x)) { if (fnmatch (*x, s, FNM_PATHNAME) == 0) break; } else { - char *p = *x + (flags & ALLABS && **x == '/'); /* Remove '/' */ + char *p = *x + ((flags & ALLABS) && (**x == '/')); /* Remove '/' */ if (frontcmp (p, s)) break; } @@ -619,7 +650,7 @@ { for (; *accepts; accepts++) { - if (has_wildcards (*accepts)) + if (has_wildcards_p (*accepts)) { /* fnmatch returns 0 if the pattern *does* match the string. */ @@ -660,9 +691,6 @@ return NULL; } -/* The size of the initial buffer for read_whole_line. */ -#define DYNAMIC_LINE_BUFFER 40 - /* Read a line from FP. The function reallocs the storage as needed to accomodate for any length of the line. Reallocs are done storage exponentially, doubling the storage after each overflow to @@ -678,7 +706,7 @@ int i, bufsize, c; i = 0; - bufsize = DYNAMIC_LINE_BUFFER; + bufsize = 40; line = (char *)xmalloc (bufsize); /* Construct the line. */ while ((c = getc (fp)) != EOF && c != '\n') @@ -700,8 +728,6 @@ return line; } -#define FILE_BUFFER_SIZE 512 - /* Load file pointed to by FP to memory and return the malloc-ed buffer with the contents. *NREAD will contain the number of read bytes. The file is loaded in chunks, allocated exponentially, @@ -711,7 +737,7 @@ { long bufsize; - bufsize = FILE_BUFFER_SIZE; + bufsize = 512; *nread = 0; *buf = NULL; while (!feof (fp) && !ferror (fp)) @@ -728,13 +754,13 @@ void free_vec (char **vec) { - int i; - - if (!vec) - return; - for (i = 0; vec[i]; i++) - free (vec[i]); - free (vec); + if (vec) + { + char **p = vec; + while (*p) + free (*p++); + free (vec); + } } /* Append vector V2 to vector V1. The function frees V2 and @@ -869,9 +895,6 @@ } } -/* Separator for legible numbers */ -#define LEGIBLE_SEPARATOR ',' - /* Legible -- return a static pointer to the legibly printed long. */ char * legible (long l) @@ -902,7 +925,7 @@ for (i1 = i, i = 0; inptr[i1]; i++, i1++) { if (i % 3 == 0 && i1 != 0) - *outptr++ = LEGIBLE_SEPARATOR; + *outptr++ = ','; *outptr++ = inptr[i1]; } /* Zero-terminate the string. */ @@ -914,9 +937,9 @@ int numdigit (long a) { - int res; - - for (res = 1; (a /= 10) != 0; res++); + int res = 1; + while ((a /= 10) != 0) + ++res; return res; } diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/utils.h wget-1.5.1/src/utils.h --- wget-1.5.0/src/utils.h Mon Apr 20 00:47:48 1998 +++ wget-1.5.1/src/utils.h Sat May 2 05:09:46 1998 @@ -43,13 +43,14 @@ char **sepstring PARAMS ((const char *)); int frontcmp PARAMS ((const char *, const char *)); char *pwd_cuserid PARAMS ((char *)); +void fork_to_background PARAMS ((void)); void path_simplify PARAMS ((char *)); -void touch PARAMS ((char *, time_t)); +void touch PARAMS ((const char *, time_t)); int remove_link PARAMS ((const char *)); int file_exists_p PARAMS ((const char *)); int file_non_directory_p PARAMS ((const char *)); -int mkdirhier PARAMS ((const char *)); +int make_directory PARAMS ((const char *)); char *unique_name PARAMS ((const char *)); int acceptable PARAMS ((const char *)); diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/version.c wget-1.5.1/src/version.c --- wget-1.5.0/src/version.c Mon Apr 20 01:03:22 1998 +++ wget-1.5.1/src/version.c Fri Apr 24 00:29:54 1998 @@ -1 +1 @@ -char *version_string = "1.5.0"; +char *version_string = "1.5.1"; diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/src/wget.h wget-1.5.1/src/wget.h --- wget-1.5.0/src/wget.h Sun Apr 5 06:06:44 1998 +++ wget-1.5.1/src/wget.h Fri May 1 19:47:06 1998 @@ -26,7 +26,7 @@ #ifndef DEBUG # define NDEBUG /* To kill off assertions */ -#endif /* DEBUG */ +#endif /* not DEBUG */ #ifndef PARAMS # if PROTOTYPES @@ -66,7 +66,6 @@ /* Include these, so random files need not include them. */ #include "sysdep.h" #include "options.h" -#include "cmpt.h" #define DO_NOTHING do {} while (0) @@ -112,6 +111,13 @@ /* The smaller value of the two. */ #define MINVAL(x, y) ((x) < (y) ? (x) : (y)) +/* ASCII char -> HEX digit */ +#define ASC2HEXD(x) (((x) >= '0' && (x) <= '9') ? \ + ((x) - '0') : (toupper(x) - 'A' + 10)) + +/* HEX digit -> ASCII char */ +#define HEXD2ASC(x) (((x) < 10) ? ((x) + '0') : ((x) - 10 + 'A')) + #define ARRAY_SIZE(array) (sizeof (array) / sizeof (*(array))) #define STRDUP_ALLOCA(ptr, str) do { \ @@ -149,15 +155,20 @@ /* Free FOO if it is non-NULL. */ #define FREE_MAYBE(foo) do { if (foo) free (foo); } while (0) +/* #### Hack: OPTIONS_DEFINED_HERE is defined in main.c. */ +#ifndef OPTIONS_DEFINED_HERE +extern const char *exec_name; +#endif + /* Document-type flags */ enum { - TEXTHTML = 0x0001, /* Document is of type text/html */ - RETROKF = 0x0002, /* Retrieval was OK */ - HEAD_ONLY = 0x0004, /* Only send the HEAD request */ - SEND_NOCACHE = 0x0008, /* Send Pragma: no-cache directive */ - ACCEPTRANGES = 0x0010 /* Accept-ranges header was found */ + TEXTHTML = 0x0001, /* document is of type text/html */ + RETROKF = 0x0002, /* retrieval was OK */ + HEAD_ONLY = 0x0004, /* only send the HEAD request */ + SEND_NOCACHE = 0x0008, /* send Pragma: no-cache directive */ + ACCEPTRANGES = 0x0010 /* Accept-ranges header was found */ }; /* Universal error type -- used almost everywhere. @@ -176,7 +187,7 @@ FTPINVPASV, FTPNOPASV, RETRFINISHED, READERR, TRYLIMEXC, URLBADPATTERN, FILEBADFILE, RANGEERR, RETRBADPATTERN, RETNOTSUP, - ROBOTSOK, NOROBOTS, PROXERR, QUOTEXC, WRITEFAILED + ROBOTSOK, NOROBOTS, PROXERR, AUTHFAILED, QUOTEXC, WRITEFAILED } uerr_t; #endif /* WGET_H */ diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/windows/Makefile.doc wget-1.5.1/windows/Makefile.doc --- wget-1.5.0/windows/Makefile.doc Wed Apr 1 13:47:01 1998 +++ wget-1.5.1/windows/Makefile.doc Mon Apr 27 21:51:22 1998 @@ -1,42 +1,42 @@ -# Makefile for `wget' utility -# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -RM = del - -all: wget.hlp - -# You probably need makeinfo utility -# wget it from URL:http://www.inx.de/~cschenk/miktex/makeinfo.zip - -.IGNORE: -wget.hlp: wget.texi - makeinfo --no-validate --no-warn \ ---hpj wget.hpj --output wget.rtf wget.texi - hcrtf -xn wget.hpj - -clean: - $(RM) *.bak - $(RM) *.hpj - $(RM) *.rtf - $(RM) *.ph - -distclean: clean - $(RM) wget.hlp - $(RM) Makefile - -realclean: distclean - +# Makefile for `wget' utility +# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +RM = del + +all: wget.hlp + +# You probably need makeinfo utility +# wget it from URL:http://www.sunsite.auc.dk/wget/makeinfo.zip + +.IGNORE: +wget.hlp: wget.texi + makeinfo --no-validate --no-warn --force \ +--hpj wget.hpj --output wget.rtf wget.texi + hcrtf -xn wget.hpj + +clean: + $(RM) *.bak + $(RM) *.hpj + $(RM) *.rtf + $(RM) *.ph + +distclean: clean + $(RM) wget.hlp + $(RM) Makefile + +realclean: distclean + diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/windows/Makefile.src wget-1.5.1/windows/Makefile.src --- wget-1.5.0/windows/Makefile.src Wed Apr 1 18:00:38 1998 +++ wget-1.5.1/windows/Makefile.src Mon Apr 27 21:51:27 1998 @@ -103,7 +103,3 @@ retr$o: wget.h options.h utils.h retr.h url.h recur.h ftp.h html.h host.h connect.h url$o: wget.h url.h host.h html.h utils.h utils$o: wget.h utils.h options.h - - - - diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/windows/Makefile.top wget-1.5.1/windows/Makefile.top --- wget-1.5.0/windows/Makefile.top Wed Apr 1 18:01:25 1998 +++ wget-1.5.1/windows/Makefile.top Mon Apr 27 21:50:04 1998 @@ -21,7 +21,7 @@ # flags passed to recursive makes in subdirectories # subdirectories in the distribution -SUBDIRS = src #doc #util +SUBDIRS = src doc #util # default target all: Makefile $(SUBDIRS) diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/windows/Makefile.vc.src wget-1.5.1/windows/Makefile.vc.src --- wget-1.5.0/windows/Makefile.vc.src Wed Apr 1 13:47:01 1998 +++ wget-1.5.1/windows/Makefile.vc.src Thu Jan 1 02:00:00 1970 @@ -1,109 +0,0 @@ -# Makefile for `wget' utility for MSVC 4.0 -# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -# -# Version: 1.4.4 -# - -SHELL = command - -VPATH = . -o = .obj -OUTDIR = . - -CC = cl -LD = link - -CFLAGS = /nologo /MT /W0 /O2 -#DEBUGCF = /DDEBUG /Zi /Od #/Fd /FR -CPPFLAGS = -DEFS = /DWINDOWS /D_CONSOLE /DHAVE_CONFIG_H /DSYSTEM_WGETRC=\"wgetrc\" -LDFLAGS = /subsystem:console /incremental:no /warn:3 -#DEBUGLF = /pdb:wget.pdb /debug /debugtype:cv /map:wget.map /opt:noref -LIBS = kernel32.lib advapi32.lib wsock32.lib user32.lib - -INCLUDES = /I. /I.. - -COMPILE = $(CC) $(INCLUDES) $(CPPFLAGS) $(DEBUGCF) $(DEFS) $(CFLAGS) -LINK = $(LD) $(LDFLAGS) $(DEBUGLF) /out:$@ - -#INSTALL = @INSTALL@ -#INSTALL_PROGRAM = @INSTALL_PROGRAM@ - -RM = del - -SRC = alloca.c cmpt.c connect.c host.c http.c netrc.c ftp-basic.c ftp.c ftp-ls.c \ - ftp-opie.c getopt.c headers.c html.c retr.c recur.c url.c init.c utils.c main.c \ - version.c mswindows.c fnmatch.c md5.c rbuf.c log.c - -OBJ = alloca$o cmpt$o connect$o host$o http$o netrc$o ftp-basic$o ftp$o ftp-ls$o \ - ftp-opie$o headers$o html$o retr$o recur$o url$o init$o utils$o main$o \ - getopt$o version$o mswindows$o fnmatch$o md5$o rbuf$o log$o - -.SUFFIXES: .c .obj - -.c.obj: - $(COMPILE) /c $< - -# Dependencies for building - -wget: wget.exe - -wget.exe: $(OBJ) - $(LD) @<< $(LDFLAGS) $(DEBUGLF) /out:$@ $(LIBS) $(OBJ) -<< - ren wget.exe WGET.EXE - - -# -# Dependencies for cleanup -# - -clean: - $(RM) *.obj - $(RM) *.exe - $(RM) *.bak - $(RM) *.pdb - $(RM) *.map - -distclean: clean - $(RM) Makefile - -realclean: distclean - $(RM) TAGS - -# Dependencies: - -connect$o: wget.h options.h utils.h connect.h host.h -ftp-basic$o: wget.h options.h utils.h ftp-basic.h connect.h host.h retr.h -ftp-ls$o: wget.h url.h utils.h ftp.h options.h -ftp$o: wget.h options.h utils.h url.h ftp.h ftp-basic.h html.h connect.h host.h retr.h netrc.h -getopt$o: getopt.h -host$o: wget.h options.h utils.h url.h host.h -html$o: wget.h options.h url.h utils.h ftp.h html.h -http$o: wget.h options.h utils.h url.h host.h retr.h connect.h netrc.h -init$o: wget.h options.h utils.h init.h url.h ftp.h host.h recur.h netrc.h -main$o: wget.h options.h utils.h url.h init.h retr.h recur.h ftp.h getopt.h -netrc$o: wget.h utils.h netrc.h options.h -recur$o: wget.h options.h url.h recur.h utils.h retr.h ftp.h host.h -retr$o: wget.h options.h utils.h retr.h url.h recur.h ftp.h html.h host.h connect.h -url$o: wget.h url.h host.h html.h utils.h -utils$o: wget.h utils.h options.h - - - - diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/windows/Makefile.vc.top wget-1.5.1/windows/Makefile.vc.top --- wget-1.5.0/windows/Makefile.vc.top Wed Apr 1 13:47:01 1998 +++ wget-1.5.1/windows/Makefile.vc.top Thu Jan 1 02:00:00 1970 @@ -1,69 +0,0 @@ -# Makefile for `Wget' utility -# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -RM = del -CP = copy - -# flags passed to recursive makes in subdirectories - -# subdirectories in the distribution -SUBDIRS = src #doc #util - -# default target -all: Makefile $(SUBDIRS) - -$(SUBDIRS): FORCE - cd $@ - $(MAKE) - cd .. - -FORCE: - -# install everything -install: - echo Just do it. - -clean: clean-recursive clean-top -distclean: distclean-recursive distclean-top -realclean: realclean-recursive realclean-top - -clean-top: - $(RM) *.bak - $(RM) *.zip - -distclean-top: clean-top - $(RM) Makefile - $(RM) config.h - -realclean-top: distclean-top - -clean-recursive distclean-recursive realclean-recursive: - cd src - $(MAKE) $(@:-recursive=) - cd ..\\doc - $(MAKE) $(@:-recursive=) - cd .. - -bindist: wget.zip - -wget.zip: $(SUBDIRS) - $(RM) wget.zip - zip -Djl9@ wget.zip < << -AUTHORS COPYING INSTALL MACHINES MAILING-LIST NEWS README DOC\\sample.wgetrc -<< - zip -Dj9 wget.zip SRC\\WGET.EXE DOC\\WGET.HLP - diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/windows/README wget-1.5.1/windows/README --- wget-1.5.0/windows/README Thu Jun 12 14:33:43 1997 +++ wget-1.5.1/windows/README Mon Apr 27 21:52:17 1998 @@ -1,5 +1,15 @@ -*- text -*- -This directory contains files needed to compile GNU Wget on Windows. -This is currently in the development phase; contact Darko Budor - for details. +To build Wget with VC++ 5.0 run configure.bat in the wget directory, +and then run nmake. If you want to build the help file you will need +a copy of makinfo to convert wget.texi to rtf. I've made a copy +available at . This +copy of makeinfo is from the miktxt 1.10 archive available from ctan. + +Darko Budor did most of the work for the +original port of Wget to Windows. Tim Charron +did most of the work cleaning things up and contributed the watcom +makefile. I made some minor changes and cleaned up the the VC++ +makefile to get a clean build with VC++ 5.0 on Windows 95. + +John Burden diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/windows/config.h.bor wget-1.5.1/windows/config.h.bor --- wget-1.5.0/windows/config.h.bor Thu Jan 1 02:00:00 1970 +++ wget-1.5.1/windows/config.h.bor Fri May 1 18:28:37 1998 @@ -0,0 +1,170 @@ +/* Configuration header file. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +#ifndef CONFIG_H +#define CONFIG_H + +/* Define if you have the header file. */ +#undef HAVE_ALLOCA_H + +/* AIX requires this to be the first thing in the file. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +/* #undef _ALL_SOURCE */ +#endif + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define as the return type of signal handlers (int or void). */ +#define RETSIGTYPE int + +/* Define if your architecture is big endian (with the most + significant byte first). */ +#undef WORDS_BIGENDIAN + +/* Define this if you want the NLS support. */ +#undef ENABLE_NLS + +/* Define if you want the FTP support for Opie compiled in. */ +#define USE_OPIE 1 + +/* Define if you want the HTTP Digest Authorization compiled in. */ +#define USE_DIGEST 1 + +/* Define if you want the debug output support compiled in. */ +#undef DEBUG + +/* Define if you have sys/time.h header. */ +#undef HAVE_SYS_TIME_H + +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define if you have struct utimbuf. */ +#define HAVE_STRUCT_UTIMBUF 1 + +/* Define if you have the gethostbyname function. */ +/* #undef HAVE_GETHOSTBYNAME */ + +/* Define if you have the uname function. */ +#undef HAVE_UNAME + +/* Define if you have the gethostname function. */ +#define HAVE_GETHOSTNAME 1 + +/* Define if you have the select function. */ +#define HAVE_SELECT 1 + +/* Define if you have the gettimeofday function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define if you have the strdup function. */ +#define HAVE_STRDUP 1 + +/* Define if you have the sys/utsname.h header. */ +#undef HAVE_SYS_UTSNAME_H + +/* Define if you have the strerror function. */ +#define HAVE_STRERROR 1 + +/* Define if you have the strstr function. */ +#define HAVE_STRSTR 1 + +/* Define if you have the strcasecmp function. */ +#define HAVE_STRCASECMP 1 + +/* Define if you have the strncasecmp function. */ +#define HAVE_STRNCASECMP 1 + +/* Define if you have the strptime function. */ +#undef HAVE_STRPTIME + +/* Define if you have the mktime function. */ +#define HAVE_MKTIME 1 + +/* Define if you have the symlink function. */ +#undef HAVE_SYMLINK + +/* Define if you have the signal function. */ +#undef HAVE_SIGNAL + +/* Define if you have the header file. */ +#define HAVE_STDARG_H 1 + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the header file. */ +/* #define HAVE_UNISTD_H 1 */ +#undef HAVE_UNISTD_H + +/* Define if you have the header file. */ +#define HAVE_UTIME_H 1 + +/* Define if you have the header file. */ +#undef HAVE_SYS_UTIME_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define if you have the header file. */ +#undef HAVE_PWD_H + +/* Define if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to be the name of the operating system. */ +#define OS_TYPE "Windows" + +#define CTRLBREAK_BACKGND 1 + +/* Define if you wish to compile with socks support. */ +/* #undef HAVE_SOCKS */ + +/* Define to 1 if ANSI function prototypes are usable. */ +#define PROTOTYPES 1 + +#endif /* CONFIG_H */ diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/windows/config.vc wget-1.5.1/windows/config.vc --- wget-1.5.0/windows/config.vc Wed Apr 1 13:47:01 1998 +++ wget-1.5.1/windows/config.vc Thu Jan 1 02:00:00 1970 @@ -1,195 +0,0 @@ -/* Configuration header file. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - - -#ifndef CONFIG_H -#define CONFIG_H - -/* Undef if you do not want debug support. It is generally a good - idea to have debug support compiled in, because it enables the `-d' - option, crucial when sending bug reports. */ -#define DEBUG - -#ifndef DEBUG -# define NDEBUG /* To kill off assertions */ -#endif /* DEBUG */ - -/* Define if you have the header file. */ -#undef HAVE_ALLOCA_H - -/* AIX requires this to be the first thing in the file. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -#endif - -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -/* #undef _ALL_SOURCE */ -#endif - -/* Define to empty if the keyword does not work. */ -/* #undef const */ - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define as the return type of signal handlers (int or void). */ -#define RETSIGTYPE int - -/* Define if you have sys/time.h header. */ -#undef HAVE_SYS_TIME_H - -/* Define if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define if you have struct utimbuf. */ -#define HAVE_STRUCT_UTIMBUF 1 - -/* Define if you have the gethostbyname function. */ -/* #undef HAVE_GETHOSTBYNAME */ - -/* Define if you have the uname function. */ -#undef HAVE_UNAME - -/* Define if you have the gethostname function. */ -#define HAVE_GETHOSTNAME 1 - -/* Define if you have the select function. */ -#define HAVE_SELECT 1 - -/* Define if you have the gettimeofday function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define if you have the strdup function. */ -#define HAVE_STRDUP 1 - -/* Define if you have the sys/utsname.h header. */ -#undef HAVE_SYS_UTSNAME_H - -/* Define if you have the strerror function. */ -#define HAVE_STRERROR 1 - -/* Define if you have the strstr function. */ -#define HAVE_STRSTR 1 - -/* Define if you have the strcasecmp function. */ -#undef HAVE_STRCASECMP - -/* Define if you have the strncasecmp function. */ -#undef HAVE_STRNCASECMP - -/* Define if you have the strptime function. */ -#undef HAVE_STRPTIME - -/* Define if you have the mktime function. */ -#define HAVE_MKTIME 1 - -/* Define if you have the symlink function. */ -#undef HAVE_SYMLINK - -/* Define if you have the signal function. */ -#undef HAVE_SIGNAL - -/* Define if you have the header file. */ -#define HAVE_STDARG_H 1 - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_UNISTD_H 1 */ -#undef HAVE_UNISTD_H - -/* Define if you have the header file. */ -#undef HAVE_UTIME_H - -/* Define if you have the header file. */ -#define HAVE_SYS_UTIME_H 1 - -/* Define if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define if you have the header file. */ -#undef HAVE_PWD_H - -/* Define if you have the header file. */ -#undef HAVE_SIGNAL_H - -/* Define to be the name of the operating system. */ -#define OS_TYPE "Windows" - -#define CTRLBREAK_BACKGND 1 - -/* Define if you wish to compile with socks support. */ -/* #undef HAVE_SOCKS */ - -/* Define to 1 if ANSI function prototypes are usable. */ -#define PROTOTYPES 1 - -/* If the user has socks, use it. */ -#ifdef HAVE_SOCKS -#define connect Rconnect -#define getsockname Rgetsockname -#define bind Rbind -#define accept Raccept -#define listen Rlisten -#define select Rselect -#endif /* HAVE_SOCKS */ - -#ifndef HAVE_STRERROR -char *strerror (int); -#endif /* HAVE_STRERROR */ - -/* Stub for future internationalization. */ -#define _(string) string - -/* I18N NOTE: You will notice that none of the DEBUG messages are - marked as translatable. This is intentional, for a few reasons: - - 1) The messages are not meant for the users to look at, but for the - developers -- they should be considered more like source comments - than real program output. - - 2) The messages are numerous, and yet they are silly and random - ("double yuck!" and such). There would be a lot of work with zero - gain. - - 3) Finally, the debug messages are meant to be a clue for me to - debug problems with Wget. If I get them in a language I don't - understand, debugging will become a new challenge of its own! :-) */ - -#endif /* CONFIG_H */ diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/windows/configurevc.bat wget-1.5.1/windows/configurevc.bat --- wget-1.5.0/windows/configurevc.bat Wed Apr 1 13:47:01 1998 +++ wget-1.5.1/windows/configurevc.bat Thu Jan 1 02:00:00 1970 @@ -1,32 +0,0 @@ -@echo off -rem Configure batch file for `Wget' utility -rem Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - -rem This program is free software; you can redistribute it and/or modify -rem it under the terms of the GNU General Public License as published by -rem the Free Software Foundation; either version 2 of the License, or -rem (at your option) any later version. - -rem This program is distributed in the hope that it will be useful, -rem but WITHOUT ANY WARRANTY; without even the implied warranty of -rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -rem GNU General Public License for more details. - -rem You should have received a copy of the GNU General Public License -rem along with this program; if not, write to the Free Software -rem Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -cls -copy config.vc ..\config.h > nul -copy Makefile.vc.top ..\Makefile > nul -copy Makefile.vc.src ..\src\Makefile > nul -copy Makefile.doc ..\doc\Makefile > nul -copy *.h ..\src -copy *.c ..\src - -cd .. - -echo Type NMAKE to start compiling. -echo If it doesn't work, try executing MSDEV\BIN\VCVARS32.BAT first, -echo and then NMAKE. - diff -Nru -x TAGS -x *info* -x *.po wget-1.5.0/windows/makefile.bor wget-1.5.1/windows/makefile.bor --- wget-1.5.0/windows/makefile.bor Thu Jan 1 02:00:00 1970 +++ wget-1.5.1/windows/makefile.bor Fri May 1 18:28:27 1998 @@ -0,0 +1,106 @@ +## Compiler, linker, and lib stuff +## Makefile for use with watcom win95/winnt executable. + +CC=bcc32 +LINK=tlink32 + +LFLAGS= +CFLAGS=-DWINDOWS -DHAVE_CONFIG_H -I. -H -H=wget.csm -w- + +## variables +OBJS=cmpt.obj connect.obj fnmatch.obj ftp.obj ftp-basic.obj \ + ftp-ls.obj ftp-opie.obj getopt.obj headers.obj host.obj html.obj \ + http.obj init.obj log.obj main.obj md5.obj netrc.obj rbuf.obj \ + alloca.obj \ + recur.obj retr.obj url.obj utils.obj version.obj mswindows.obj + +LIBDIR=$(MAKEDIR)\..\lib + +wget.exe: $(OBJS) + $(LINK) @&&| +$(LFLAGS) -Tpe -ap -c + +$(LIBDIR)\c0x32.obj+ +alloca.obj+ +version.obj+ +utils.obj+ +url.obj+ +retr.obj+ +recur.obj+ +rbuf.obj+ +netrc.obj+ +mswindows.obj+ +md5.obj+ +main.obj+ +log.obj+ +init.obj+ +http.obj+ +html.obj+ +host.obj+ +headers.obj+ +getopt.obj+ +ftp-opie.obj+ +ftp-ls.obj+ +ftp-basic.obj+ +ftp.obj+ +fnmatch.obj+ +connect.obj+ +cmpt.obj +$<,$* +$(LIBDIR)\import32.lib+ +$(LIBDIR)\cw32.lib + + + +| + +config.h: ..\windows\config.h.bor + copy $** $< + +cmpt.obj : cmpt.c cmpt.h wget.h config.h + +connect.obj : connect.c wget.h connect.h host.h config.h + +fnmatch.obj : fnmatch.c wget.h fnmatch.h config.h + +ftp.obj : ftp.c wget.h utils.h url.h rbuf.h retr.h ftp.h ftp-basic.h html.h connect.h host.h fnmatch.h netrc.h config.h + +ftp-basic.obj : ftp-basic.c wget.h utils.h rbuf.h ftp-basic.h connect.h host.h config.h + +ftp-ls.obj : ftp-ls.c wget.h utils.h ftp.h config.h + +ftp-opie.obj : ftp-opie.c wget.h md5.h config.h + +getopt.obj : getopt.c wget.h getopt.h config.h + +headers.obj : headers.c headers.h wget.h rbuf.h connect.h config.h + +host.obj : host.c wget.h host.h utils.h url.h config.h + +html.obj : html.c wget.h url.h utils.h ftp.h html.h config.h + +http.obj : http.c wget.h utils.h url.h host.h rbuf.h retr.h headers.h connect.h fnmatch.h netrc.h config.h + +init.obj : init.c wget.h utils.h init.h host.h recur.h netrc.h config.h + +log.obj : log.c wget.h utils.h config.h + +main.obj : main.c wget.h utils.h getopt.h init.h retr.h host.h recur.h config.h mswindows.h + +md5.obj : md5.c wget.h md5.h config.h + +mswindows.obj : mswindows.c wget.h url.h config.h + +netrc.obj : netrc.c wget.h utils.h netrc.h init.h config.h + +rbuf.obj : rbuf.c wget.h rbuf.h connect.h config.h + +recur.obj : recur.c wget.h url.h recur.h utils.h retr.h ftp.h fnmatch.h host.h config.h + +retr.obj : retr.c wget.h utils.h retr.h url.h recur.h ftp.h host.h connect.h config.h + +url.obj : url.c wget.h url.h host.h html.h utils.h config.h + +utils.obj : utils.c wget.h fnmatch.h utils.h config.h + +version.obj : version.c config.h +