aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c29
-rw-r--r--src/makefile.dj34
-rw-r--r--src/writeenv.c6
3 files changed, 43 insertions, 26 deletions
diff --git a/src/main.c b/src/main.c
index 31a9e632a..eadc5e69f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -116,16 +116,17 @@
#define DEFAULT_MAXREDIRS 50L
#ifdef __DJGPP__
-void *xmalloc(size_t);
+#include <dos.h>
+
char *msdosify(char *);
char *rename_if_dos_device_name(char *);
-void xfree(void *);
-struct pollfd {
- int fd;
- int events; /* in param: what to poll for */
- int revents; /* out param: what events occured */
- };
-int poll (struct pollfd *, int, int);
+
+/* we want to glob our own argv[] */
+char **__crt0_glob_function (char *arg)
+{
+ (void)arg;
+ return (char**)0;
+}
#endif /* __DJGPP__ */
#ifndef __cplusplus
@@ -367,7 +368,7 @@ static void help(void)
" -v/--verbose Make the operation more talkative",
" -V/--version Show version number and quit",
#ifdef __DJGPP__
- " --wdebug Turn on WATT-32 debugging under DJGPP",
+ " --wdebug Turn on Watt-32 debugging under DJGPP",
#endif
" -w/--write-out [format] What to output after completion",
" -x/--proxy <host[:port]> Use HTTP proxy on given port",
@@ -2209,6 +2210,8 @@ static void go_sleep(long ms)
#ifdef WIN32
/* Windows offers a millisecond sleep */
Sleep(ms);
+#elif defined(__MSDOS__)
+ delay(ms);
#else
/* Other systems must use select() for this */
struct timeval timeout;
@@ -2920,10 +2923,11 @@ operate(struct Configurable *config, int argc, char *argv[])
{
/* This is for DOS, and then we do some major replacing of
bad characters in the file name before using it */
- char *file1=xmalloc(PATH_MAX);
+ char file1 [PATH_MAX];
+
strcpy(file1, msdosify(outfile));
- strcpy(outfile, rename_if_dos_device_name(file1));
- xfree(file1);
+ free (outfile);
+ outfile = strdup (rename_if_dos_device_name(file1));
}
#endif /* __DJGPP__ */
}
@@ -3688,7 +3692,6 @@ rename_if_dos_device_name (char *file_name)
/* We could have a file whose name is a device on MS-DOS. Trying to
* retrieve such a file would fail at best and wedge us at worst. We need
* to rename such files. */
- extern char *basename (const char *);
char *base;
struct stat st_buf;
char fname[PATH_MAX];
diff --git a/src/makefile.dj b/src/makefile.dj
index 5e2102a7e..5517d87f1 100644
--- a/src/makefile.dj
+++ b/src/makefile.dj
@@ -17,6 +17,8 @@ endif
EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a
+CFLAGS += -DUSE_MANUAL -DUSE_ENVIRONMENT
+
PROGRAM = ../curl.exe
SOURCES = getpass.c homedir.c hugehelp.c main.c urlglob.c writeenv.c writeout.c
OBJECTS = $(SOURCES:.c=.o)
@@ -34,7 +36,7 @@ config.h:
#
hugehelp.c: ../docs/MANUAL ../docs/curl.1 mkhelp.pl
groff -Tascii -man ../docs/curl.1 | \
- perl -w mkhelp.pl ../docs/MANUAL ../readme > $@
+ perl -w mkhelp.pl ../docs/MANUAL > $@
clean:
- rm -f $(OBJECTS) Makefile.bak config.h
@@ -43,17 +45,23 @@ realclean vclean: clean
- rm -f $(PROGRAM) hugehelp.c
# DO NOT DELETE THIS LINE
-getpass.o: getpass.c setup.h config.h ../lib/config.dj
-homedir.o: homedir.c setup.h config.h ../lib/config.dj
-hugehelp.o: hugehelp.c
-main.o: main.c setup.h config.h ../lib/config.dj ../include/curl/curl.h \
+getpass.o: getpass.c setup.h config.h ../lib/config.dj ../lib/setup.h \
+ ../lib/config.h getpass.h ../lib/memdebug.h
+homedir.o: homedir.c setup.h config.h ../lib/config.dj ../lib/setup.h \
+ ../lib/config.h homedir.h ../lib/memdebug.h
+hugehelp.o: hugehelp.c hugehelp.h
+main.o: main.c setup.h config.h ../lib/config.dj ../lib/setup.h \
+ ../lib/config.h ../include/curl/curl.h ../include/curl/curlver.h \
../include/curl/types.h ../include/curl/easy.h ../include/curl/multi.h \
../include/curl/mprintf.h urlglob.h writeout.h getpass.h homedir.h \
- version.h
-urlglob.o: urlglob.c setup.h config.h ../lib/config.dj \
- ../include/curl/curl.h ../include/curl/types.h ../include/curl/easy.h \
- ../include/curl/multi.h ../include/curl/mprintf.h urlglob.h
-writeenv.o: writeenv.c setup.h config.h ../lib/config.dj
-writeout.o: writeout.c setup.h config.h ../lib/config.dj \
- ../include/curl/curl.h ../include/curl/types.h ../include/curl/easy.h \
- ../include/curl/multi.h ../include/curl/mprintf.h writeout.h
+ hugehelp.h version.h ../lib/strtoofft.h ../lib/memdebug.h
+urlglob.o: urlglob.c setup.h config.h ../lib/config.dj ../lib/setup.h \
+ ../lib/config.h ../include/curl/curl.h ../include/curl/curlver.h \
+ ../include/curl/types.h ../include/curl/easy.h ../include/curl/multi.h \
+ ../include/curl/mprintf.h urlglob.h ../lib/memdebug.h
+writeenv.o: writeenv.c setup.h config.h ../lib/config.dj ../lib/setup.h \
+ ../lib/config.h
+writeout.o: writeout.c setup.h config.h ../lib/config.dj ../lib/setup.h \
+ ../lib/config.h ../include/curl/curl.h ../include/curl/curlver.h \
+ ../include/curl/types.h ../include/curl/easy.h ../include/curl/multi.h \
+ ../include/curl/mprintf.h writeout.h
diff --git a/src/writeenv.c b/src/writeenv.c
index 4a0b64df5..833d9a679 100644
--- a/src/writeenv.c
+++ b/src/writeenv.c
@@ -64,6 +64,10 @@ static void internalSetEnv(const char * name, char * value)
/* Add your OS-specific code here. */
#ifdef __riscos__
_kernel_setenv(name, value);
+#elif defined (CURLDEBUG)
+ extern FILE *curl_debuglogfile;
+ if (curl_debuglogfile)
+ fprintf (curl_debuglogfile, "ENV %s = %s\n", name, value);
#endif
return;
}
@@ -100,6 +104,8 @@ void ourWriteEnv(CURL *curl)
else
internalSetEnv(variables[i].name, NULL);
break;
+ default:
+ break;
}
}