projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
db7bef7
)
wtf is gl_string? unused variable, removed it
author
Art Cancro
<ajc@uncensored.citadel.org>
Thu, 19 Apr 2012 15:53:36 +0000
(11:53 -0400)
committer
Art Cancro
<ajc@uncensored.citadel.org>
Thu, 19 Apr 2012 15:53:36 +0000
(11:53 -0400)
citadel/textclient/commands.c
patch
|
blob
|
history
diff --git
a/citadel/textclient/commands.c
b/citadel/textclient/commands.c
index 3175f12b350d20005434cafbf1bf54998b19bf08..bb9da5d7d07d8f76e52acbc0062268645874c3ad 100644
(file)
--- a/
citadel/textclient/commands.c
+++ b/
citadel/textclient/commands.c
@@
-92,7
+92,6
@@
char rc_url_cmd[SIZ];
char rc_open_cmd[SIZ];
char rc_gotmail_cmd[SIZ];
char rc_open_cmd[SIZ];
char rc_gotmail_cmd[SIZ];
-char *gl_string;
int next_lazy_cmd = 5;
extern int screenwidth, screenheight;
int next_lazy_cmd = 5;
extern int screenwidth, screenheight;
@@
-492,14
+491,16
@@
int yesno_d(int d)
*
* string Pointer to string buffer
* lim Maximum length
*
* string Pointer to string buffer
* lim Maximum length
- * noshow If nonzero, echo asterisks instead of keystrokes
+ * noshow Echo asterisks instead of keystrokes?
+ * bs Allow backspacing out of the prompt?
+ *
+ * returns: string length
*/
*/
-
void ctdl_getline(char *string, int lim, int noshow
)
+
int ctdl_getline(char *string, int lim, int noshow, int bs
)
{
int a, b;
strcpy(string, "");
{
int a, b;
strcpy(string, "");
- gl_string = string;
async_ka_start();
GLA: a = inkey();
async_ka_start();
GLA: a = inkey();
@@
-522,7
+523,7
@@
GLA: a = inkey();
if ((a == 10)) {
scr_putc(10);
async_ka_end();
if ((a == 10)) {
scr_putc(10);
async_ka_end();
- return;
+ return
(strlen(string))
;
}
if (a < 32) {
a = '.';
}
if (a < 32) {
a = '.';
@@
-540,9
+541,10
@@
GLA: a = inkey();
}
}
-/*
- * strprompt() - prompt for a string, print the existing value and
- * allow the user to press return to keep it...
+/*
+ * newprompt() prompt for a string, print the existing value, and
+ * allow the user to press return to keep it...
+ * If len is negative, pass the "noshow" flag to ctdl_getline()
*/
void strprompt(char *prompt, char *str, int len)
{
*/
void strprompt(char *prompt, char *str, int len)
{
@@
-570,7
+572,7
@@
void strprompt(char *prompt, char *str, int len)
color(DIM_WHITE);
scr_printf(": ");
color(BRIGHT_CYAN);
color(DIM_WHITE);
scr_printf(": ");
color(BRIGHT_CYAN);
- ctdl_getline(buf, abs(len), (len<0));
+ ctdl_getline(buf, abs(len), (len<0)
, 0
);
if (buf[0] != 0) {
strcpy(str, buf);
}
if (buf[0] != 0) {
strcpy(str, buf);
}
@@
-628,8
+630,9
@@
int intprompt(char *prompt, int ival, int imin, int imax)
}
/*
}
/*
- * newprompt() - prompt for a string with no existing value
- * (clears out string buffer first)
+ * newprompt() prompt for a string with no existing value
+ * (clears out string buffer first)
+ * If len is negative, pass the "noshow" flag to ctdl_getline()
*/
void newprompt(char *prompt, char *str, int len)
{
*/
void newprompt(char *prompt, char *str, int len)
{
@@
-637,7
+640,7
@@
void newprompt(char *prompt, char *str, int len)
color(BRIGHT_MAGENTA);
scr_printf("%s", prompt);
color(DIM_MAGENTA);
color(BRIGHT_MAGENTA);
scr_printf("%s", prompt);
color(DIM_MAGENTA);
- ctdl_getline(str, abs(len), (len<0));
+ ctdl_getline(str, abs(len), (len<0)
, 0
);
color(DIM_WHITE);
}
color(DIM_WHITE);
}
@@
-1053,7
+1056,7
@@
int getcmd(CtdlIPC *ipc, char *argbuf)
/* We've found our command. */
if (requires_string(cptr, cmdpos)) {
argbuf[0] = 0;
/* We've found our command. */
if (requires_string(cptr, cmdpos)) {
argbuf[0] = 0;
- ctdl_getline(argbuf, 64, 0);
+ ctdl_getline(argbuf, 64, 0
, 0
);
} else {
scr_printf("\n");
}
} else {
scr_printf("\n");
}