diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/getpass.c | 15 | ||||
-rw-r--r-- | src/main.c | 17 | ||||
-rw-r--r-- | src/setup.h | 6 |
3 files changed, 33 insertions, 5 deletions
diff --git a/src/getpass.c b/src/getpass.c index b5f2bc4ec..7209a2ab1 100644 --- a/src/getpass.c +++ b/src/getpass.c @@ -95,9 +95,18 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) #define DONE #endif /* VMS */ + #ifdef WIN32 /* Windows implementation */ #include <conio.h> +#endif + +#ifdef __SYMBIAN32__ +#define getch() getchar() +#endif + +#if defined(WIN32) || defined(__SYMBIAN32__) + char *getpass_r(const char *prompt, char *buffer, size_t buflen) { size_t i; @@ -105,7 +114,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) for(i=0; i<buflen; i++) { buffer[i] = getch(); - if ( buffer[i] == '\r' ) { + if ( buffer[i] == '\r' || buffer[i] == '\n' ) { buffer[i] = 0; break; } @@ -115,8 +124,10 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) previous one as well */ i = i - (i>=1?2:1); } +#ifndef __SYMBIAN32__ /* since echo is disabled, print a newline */ fputs("\n", stderr); +#endif /* if user didn't hit ENTER, terminate buffer */ if (i==buflen) buffer[buflen-1]=0; @@ -124,7 +135,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) return buffer; /* we always return success */ } #define DONE -#endif /* WIN32 */ +#endif /* WIN32 || __SYMBIAN32__ */ #ifdef NETWARE /* NetWare implementation */ diff --git a/src/main.c b/src/main.c index e3b3a6fe3..e9e1cb543 100644 --- a/src/main.c +++ b/src/main.c @@ -124,6 +124,15 @@ #include "memdebug.h" #endif +#if defined(NETWARE) +#define PRINT_LINES_PAUSE 23 +#endif + +#if defined(__SYMBIAN32__) +#define PRINT_LINES_PAUSE 16 +#define pressanykey() getchar() +#endif + #define DEFAULT_MAXREDIRS 50L #if defined(O_BINARY) && defined(HAVE_SETMODE) @@ -787,8 +796,8 @@ static void help(void) }; for(i=0; helptext[i]; i++) { puts(helptext[i]); -#ifdef NETWARE - if (i && ((i % 23) == 0)) +#ifdef PRINT_LINES_PAUSE + if (i && ((i % PRINT_LINES_PAUSE) == 0)) pressanykey(); #endif } @@ -4988,6 +4997,10 @@ int main(int argc, char *argv[]) checkfds(); res = operate(&config, argc, argv); +#ifdef __SYMBIAN32__ + if (config.showerror) + pressanykey(); +#endif free_config_fields(&config); #ifdef __NOVELL_LIBC__ diff --git a/src/setup.h b/src/setup.h index 41ba43084..b6a30b957 100644 --- a/src/setup.h +++ b/src/setup.h @@ -29,7 +29,7 @@ * Define WIN32 when build target is Win32 API */ -#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && !defined(__SYMBIAN32__) #define WIN32 #endif @@ -58,6 +58,10 @@ #include "config-amigaos.h" #endif +#ifdef __SYMBIAN32__ +#include "config-symbian.h" +#endif + #ifdef TPF #include "config-tpf.h" /* change which select is used for the curl command line tool */ |