diff options
author | Gunter Knauf <gk@gknw.de> | 2007-06-30 20:08:13 +0000 |
---|---|---|
committer | Gunter Knauf <gk@gknw.de> | 2007-06-30 20:08:13 +0000 |
commit | afdfa4bed24c9f937bc49807c6d547ac3a158525 (patch) | |
tree | 6ae4f7930b6bde890fd9792f68f19a914e7e14c0 /src | |
parent | 3fc6faf1ae48f15f627ccd4fae92d9c085876d42 (diff) |
minor patches to enable building for NetWare CLIB.
sent by Dmitry Mityugov.
Diffstat (limited to 'src')
-rw-r--r-- | src/curlutil.c | 3 | ||||
-rw-r--r-- | src/getpass.c | 20 | ||||
-rw-r--r-- | src/main.c | 7 |
3 files changed, 29 insertions, 1 deletions
diff --git a/src/curlutil.c b/src/curlutil.c index 0394d80e2..2bb3f8e79 100644 --- a/src/curlutil.c +++ b/src/curlutil.c @@ -70,6 +70,9 @@ static int gettimeofday(struct timeval *tp, void *nothing) } #else /* WIN32 */ /* non-win32 version of Curl_gettimeofday() */ +#if (defined(NETWARE) && !defined(__NOVELL_LIBC__)) +#include <sys/timeval.h> +#endif static int gettimeofday(struct timeval *tp, void *nothing) { (void)nothing; /* we don't support specific time-zones */ diff --git a/src/getpass.c b/src/getpass.c index 93b061f2d..244b29b9e 100644 --- a/src/getpass.c +++ b/src/getpass.c @@ -126,11 +126,31 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) #ifdef NETWARE /* NetWare implementation */ +#ifdef __NOVELL_LIBC__ #include <screen.h> char *getpass_r(const char *prompt, char *buffer, size_t buflen) { return getpassword(prompt, buffer, buflen); } +#else +#include <nwconio.h> +char *getpass_r(const char *prompt, char *buffer, size_t buflen) +{ + int i = 0; + int c; + + printf("%s", prompt); + do { + c = getch(); + if (c != 13) { + buffer[i] = c; + i++; + printf("%s", "*"); + } + } while ((c != 13) && (i < buflen)); + return buffer; +} +#endif /* __NOVELL_LIBC__ */ #define DONE #endif /* NETWARE */ diff --git a/src/main.c b/src/main.c index 716162126..1869ce16e 100644 --- a/src/main.c +++ b/src/main.c @@ -47,8 +47,13 @@ #define CURLseparator "--_curl_--" +#ifdef NETWARE #ifdef __NOVELL_LIBC__ #include <screen.h> +#else +#include <nwconio.h> +#define mkdir mkdir_510 +#endif #endif #include "version.h" @@ -731,7 +736,7 @@ static void help(void) }; for(i=0; helptext[i]; i++) { puts(helptext[i]); -#ifdef __NOVELL_LIBC__ +#ifdef NETWARE if (i && ((i % 23) == 0)) pressanykey(); #endif |