]> sjero.net Git - wget/commitdiff
More MS-DOS fixes.
authorGisle Vanem <gvanem@broadpark.no>
Tue, 8 Sep 2009 16:33:28 +0000 (09:33 -0700)
committerGisle Vanem <gvanem@broadpark.no>
Tue, 8 Sep 2009 16:33:28 +0000 (09:33 -0700)
msdos/ChangeLog
msdos/Makefile.DJ
msdos/Makefile.WC
msdos/msdos.c [new file with mode: 0644]

index b07b359b8fb8b52cfd0760828f4f1201617fb75f..d4e741447a2a5b2f2733fc1dc6d7722754f43272 100644 (file)
@@ -1,13 +1,23 @@
+2009-09-06  Gisle Vanem  <gvanem@broadpark.no>
+
+       * Makefile.WC: Added compilation of new file msdos.c.
+       Simplified; no need to have explicit rules for files in ./lib and
+       ./md5. Just use the suffix search path mechanism in wmake.
+
+2009-09-06  Gisle Vanem  <gvanem@broadpark.no>
+
+       * Makefile.DJ: Added compilation of new file msdos.c.
+
 2009-09-05  Gisle Vanem  <gvanem@broadpark.no>
 
        * config.h: Added 'HAVE_ALLOCA_H' for Watcom 1.5+.  Added
        'USE_WATT32' since all DOS-targets use the Watt-32 tcp/ip stack.
        Added meaningless dummy LOCALEDIR.
 
-       * Makefile.wc: A much needed update. Added rules for many files
+       * Makefile.WC: A much needed update. Added rules for many files
        in ./lib, css.c and version.c.
 
-       * Makefile.dj: A much needed update. Added rules for css.c and
+       * Makefile.DJ: A much needed update. Added rules for css.c and
        version.c.
 
 2008-01-25  Micah Cowan  <micah@cowan.name>
index ef42f45f788c69ad57475b0eb81f08d09500cfa2..b37a4c28ce224bba41da06e6ed71ac8ab8d0cfc4 100644 (file)
@@ -11,7 +11,7 @@ VERSION = 1.12 (djgpp/DOS)
 
 .SUFFIXES: .exe
 
-VPATH = ../lib ../md5
+VPATH = ../lib ../md5 ../msdos
 
 USE_OPENSSL = 0
 USE_IPV6    = 1
@@ -48,6 +48,7 @@ SOURCES += cmpt.c connect.c cookies.c exits.c ftp.c ftp-basic.c ftp-ls.c \
            init.c log.c main.c gen-md5.c netrc.c progress.c recur.c \
            res.c retr.c snprintf.c url.c utils.c version.c convert.c \
            ptimer.c spider.c css.c css-url.c build_info.c ../md5/md5.c \
+           ../msdos/msdos.c \
            $(addprefix ../lib/, error.c exitfail.c quote.c \
              quotearg.c getopt.c getopt1.c xalloc-die.c xmalloc.c)
 
index 5341511a33eba88187e4cd60ebbeb826b91a7b6c..e11a162ba4d3e3d10fdc2f62222fd42eaaf1e70d 100644 (file)
@@ -12,6 +12,11 @@ COMPILE = *wcc386 -mf -3r -w3 -d2 -zq -zm -of -I. -I$(%watt_root)\inc &
 LINK = *wlink option quiet, map, verbose, eliminate, caseexact, stack=100k &
         debug all system dos32a
 
+.c: ..\lib
+.c: ..\md5
+.c: ..\msdos
+
+
 OBJ_DIR = WC_DOS.obj
 
 OBJECTS = $(OBJ_DIR)\cmpt.obj       $(OBJ_DIR)\build_info.obj &
@@ -23,7 +28,7 @@ OBJECTS = $(OBJ_DIR)\cmpt.obj       $(OBJ_DIR)\build_info.obj &
           $(OBJ_DIR)\ftp-ls.obj     $(OBJ_DIR)\ftp-opie.obj   &
           $(OBJ_DIR)\ftp.obj        $(OBJ_DIR)\gen-md5.obj    &
           $(OBJ_DIR)\getopt.obj     $(OBJ_DIR)\getopt1.obj    &
-          $(OBJ_DIR)\getpass.obj    $(OBJ_DIR)\hash.obj       &
+          $(OBJ_DIR)\hash.obj       $(OBJ_DIR)\msdos.obj      &
           $(OBJ_DIR)\host.obj       $(OBJ_DIR)\html-parse.obj &
           $(OBJ_DIR)\html-url.obj   $(OBJ_DIR)\http.obj       &
           $(OBJ_DIR)\init.obj       $(OBJ_DIR)\log.obj        &
@@ -46,50 +51,6 @@ $(OBJ_DIR):
 .c{$(OBJ_DIR)}.obj: .AUTODEPEND
        *$(COMPILE) -fo=$@ $[@
 
-.ERASE
-$(OBJ_DIR)\c-ctype.obj: ..\lib\c-ctype.c
-       *$(COMPILE) -fo=$@ $[@
-
-.ERASE
-$(OBJ_DIR)\exitfail.obj: ..\lib\exitfail.c
-       *$(COMPILE) -fo=$@ $[@
-
-.ERASE
-$(OBJ_DIR)\error.obj: ..\lib\error.c
-       *$(COMPILE) -fo=$@ $[@
-
-.ERASE
-$(OBJ_DIR)\getopt.obj: ..\lib\getopt.c
-       *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
-
-.ERASE
-$(OBJ_DIR)\getopt1.obj: ..\lib\getopt1.c
-       *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
-
-.ERASE
-$(OBJ_DIR)\getpass.obj: ..\lib\getpass.c
-       *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
-
-.ERASE
-$(OBJ_DIR)\md5.obj: ..\md5\md5.c
-       *$(COMPILE) -fo=$@ $[@
-
-.ERASE
-$(OBJ_DIR)\xmalloc.obj: ..\lib\xmalloc.c
-       *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
-
-.ERASE
-$(OBJ_DIR)\xalloc-die.obj: ..\lib\xalloc-die.c
-       *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
-
-.ERASE
-$(OBJ_DIR)\quote.obj: ..\lib\quote.c
-       *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
-
-.ERASE
-$(OBJ_DIR)\quotearg.obj: ..\lib\quotearg.c
-       *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
-
 css.c: css.l
        flex -8 -o$@ $[@
 
diff --git a/msdos/msdos.c b/msdos/msdos.c
new file mode 100644 (file)
index 0000000..f5b7e1c
--- /dev/null
@@ -0,0 +1,109 @@
+<div class="moz-text-flowed" style="font-family: -moz-fixed">/* MSDOS utility functions.
+   Copyright (C) 2009 Free Software Foundation, Inc.
+
+This file is part of GNU Wget.
+
+GNU Wget 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 3 of the License, or
+(at your option) any later version.
+
+GNU Wget 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 Wget.  If not, see <http://www.gnu.org/licenses/>.
+
+Additional permission under GNU GPL version 3 section 7
+
+If you modify this program, or any covered work, by linking or
+combining it with the OpenSSL project's OpenSSL library (or a
+modified version of that library), containing parts covered by the
+terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
+grants you additional permission to convey the resulting work.
+Corresponding Source for a non-source form of such a combination
+shall include the source code for the parts of OpenSSL used as well
+as that of the covered work.  */
+
+#include "wget.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <conio.h>
+
+/* This variable (i.e. MB_CUR_MAX) is set here so that we force a unibyte
+   locale in ../lib/quotearg.c. */
+#ifdef __DJGPP__
+int __dj_mb_cur_max = 1;
+#endif
+
+#ifndef __WATCOMC__
+/* These is just a dummy function to make Wget link. These are never called
+   because 'unibyte_locale == 1' in ../lib/quotearg.c. */
+int mbsinit (void)
+{
+  return 0;
+}
+
+int mbrtowc (void)
+{
+  return 0;
+}
+
+int iswprint (void)
+{
+  return 0;
+}
+#endif   /* __WATCOMC__ */
+
+
+#define PASS_MAX 512
+
+/* Get a user string with echo off. Handy for entering passwords. The prompt
+   optional. */
+char *
+getpass (const char *prompt)
+{
+  char getpassbuf[PASS_MAX + 1];
+  size_t i = 0;
+  int c;
+
+  if (prompt)
+    {
+      fputs (prompt, stderr);
+      fflush (stderr);
+    }
+
+  for (;;)
+    {
+      c = getch ();
+      if (c == '\r')
+       {
+         getpassbuf[i] = '\0';
+         break;
+       }
+      else if (i < PASS_MAX)
+       {
+         getpassbuf[i++] = c;
+       }
+
+      if (i >= PASS_MAX)
+       {
+         getpassbuf[i] = '\0';
+         break;
+       }
+    }
+
+  if (prompt)
+    {
+      fputs ("\r\n", stderr);
+      fflush (stderr);
+    }
+
+  return strdup (getpassbuf);
+}
+
+</div>
\ No newline at end of file