Fossil SCM
Code changes for Android, suggested by Mark Janssen.
Commit
d4d66d133a24722f2e696409d39da069407612b8
Parent
123e4bc589d5ee4…
1 file changed
+6
-2
+6
-2
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -39,25 +39,29 @@ | ||
| 39 | 39 | if( z[i]<' ' ) z[i] = ' '; |
| 40 | 40 | } |
| 41 | 41 | blob_append(pBlob, z, -1); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | -#if defined(_WIN32) | |
| 44 | +#if defined(_WIN32) || defined(__BIONIC__) | |
| 45 | 45 | #ifdef __MINGW32__ |
| 46 | 46 | #include <conio.h> |
| 47 | 47 | #endif |
| 48 | 48 | /* |
| 49 | -** getpass for Windows | |
| 49 | +** getpass for Windows and Android | |
| 50 | 50 | */ |
| 51 | 51 | static char *getpass(const char *prompt){ |
| 52 | 52 | static char pwd[64]; |
| 53 | 53 | size_t i; |
| 54 | 54 | |
| 55 | 55 | fputs(prompt,stderr); |
| 56 | 56 | fflush(stderr); |
| 57 | 57 | for(i=0; i<sizeof(pwd)-1; ++i){ |
| 58 | +#if defined(_WIN32) | |
| 58 | 59 | pwd[i] = _getch(); |
| 60 | +#else | |
| 61 | + pwd[i] = getc(stdin); | |
| 62 | +#endif | |
| 59 | 63 | if(pwd[i]=='\r' || pwd[i]=='\n'){ |
| 60 | 64 | break; |
| 61 | 65 | } |
| 62 | 66 | /* BS or DEL */ |
| 63 | 67 | else if(i>0 && (pwd[i]==8 || pwd[i]==127)){ |
| 64 | 68 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -39,25 +39,29 @@ | |
| 39 | if( z[i]<' ' ) z[i] = ' '; |
| 40 | } |
| 41 | blob_append(pBlob, z, -1); |
| 42 | } |
| 43 | |
| 44 | #if defined(_WIN32) |
| 45 | #ifdef __MINGW32__ |
| 46 | #include <conio.h> |
| 47 | #endif |
| 48 | /* |
| 49 | ** getpass for Windows |
| 50 | */ |
| 51 | static char *getpass(const char *prompt){ |
| 52 | static char pwd[64]; |
| 53 | size_t i; |
| 54 | |
| 55 | fputs(prompt,stderr); |
| 56 | fflush(stderr); |
| 57 | for(i=0; i<sizeof(pwd)-1; ++i){ |
| 58 | pwd[i] = _getch(); |
| 59 | if(pwd[i]=='\r' || pwd[i]=='\n'){ |
| 60 | break; |
| 61 | } |
| 62 | /* BS or DEL */ |
| 63 | else if(i>0 && (pwd[i]==8 || pwd[i]==127)){ |
| 64 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -39,25 +39,29 @@ | |
| 39 | if( z[i]<' ' ) z[i] = ' '; |
| 40 | } |
| 41 | blob_append(pBlob, z, -1); |
| 42 | } |
| 43 | |
| 44 | #if defined(_WIN32) || defined(__BIONIC__) |
| 45 | #ifdef __MINGW32__ |
| 46 | #include <conio.h> |
| 47 | #endif |
| 48 | /* |
| 49 | ** getpass for Windows and Android |
| 50 | */ |
| 51 | static char *getpass(const char *prompt){ |
| 52 | static char pwd[64]; |
| 53 | size_t i; |
| 54 | |
| 55 | fputs(prompt,stderr); |
| 56 | fflush(stderr); |
| 57 | for(i=0; i<sizeof(pwd)-1; ++i){ |
| 58 | #if defined(_WIN32) |
| 59 | pwd[i] = _getch(); |
| 60 | #else |
| 61 | pwd[i] = getc(stdin); |
| 62 | #endif |
| 63 | if(pwd[i]=='\r' || pwd[i]=='\n'){ |
| 64 | break; |
| 65 | } |
| 66 | /* BS or DEL */ |
| 67 | else if(i>0 && (pwd[i]==8 || pwd[i]==127)){ |
| 68 |