Fossil SCM

Code changes for Android, suggested by Mark Janssen.

jan.nijtmans 2013-03-15 15:02 trunk
Commit d4d66d133a24722f2e696409d39da069407612b8
1 file changed +6 -2
+6 -2
--- src/user.c
+++ src/user.c
@@ -39,25 +39,29 @@
3939
if( z[i]<' ' ) z[i] = ' ';
4040
}
4141
blob_append(pBlob, z, -1);
4242
}
4343
44
-#if defined(_WIN32)
44
+#if defined(_WIN32) || defined(__BIONIC__)
4545
#ifdef __MINGW32__
4646
#include <conio.h>
4747
#endif
4848
/*
49
-** getpass for Windows
49
+** getpass for Windows and Android
5050
*/
5151
static char *getpass(const char *prompt){
5252
static char pwd[64];
5353
size_t i;
5454
5555
fputs(prompt,stderr);
5656
fflush(stderr);
5757
for(i=0; i<sizeof(pwd)-1; ++i){
58
+#if defined(_WIN32)
5859
pwd[i] = _getch();
60
+#else
61
+ pwd[i] = getc(stdin);
62
+#endif
5963
if(pwd[i]=='\r' || pwd[i]=='\n'){
6064
break;
6165
}
6266
/* BS or DEL */
6367
else if(i>0 && (pwd[i]==8 || pwd[i]==127)){
6468
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button