Document, in particular use of UTF-8. Simplify code in a couple of
places, but no functional changes.
This commit is contained in:
parent
9046ff0ad2
commit
71e164ed30
17 changed files with 199 additions and 105 deletions
|
@ -44,19 +44,19 @@ getstring(char *prompt, char *buf)
|
|||
{
|
||||
*buf = '\0';
|
||||
if (prmptrd(prompt, buf, 1024) < 0)
|
||||
return 0;
|
||||
return NULL;
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
* Print sub-prompt PROMPT, receive a line of UTF8 input into BUF[1024].
|
||||
* Print sub-prompt PROMPT, receive a line of UTF-8 input into BUF[1024].
|
||||
* Return BUF on success, else NULL.
|
||||
*/
|
||||
char *
|
||||
ugetstring(char *prompt, char *buf /* buf is message text */)
|
||||
ugetstring(char *prompt, char *buf)
|
||||
{
|
||||
*buf = '\0';
|
||||
if (uprmptrd(prompt, buf, 1024) < 0)
|
||||
return 0;
|
||||
return NULL;
|
||||
return buf;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
/*
|
||||
* Parse user command in BUF.
|
||||
* BUF is user text.
|
||||
* BUF is UTF-8.
|
||||
* Set ARG[0] to point to the command name.
|
||||
* Set ARG[1..N] to point to arguments, where N is the number of
|
||||
* arguments. Set ARG[N+1..127] to NULL.
|
||||
|
@ -45,9 +45,8 @@
|
|||
* set *CONDP to the conditional argument if present, else NULL.
|
||||
* Command name and arguments are copied into SPACE[], whose size must
|
||||
* be at least strlen(BUF) + 1.
|
||||
* If *REDIR is not null, recognize the redirection syntax, and set
|
||||
* *REDIR to redirection string if present, else NULL. The
|
||||
* redirection string is user text.
|
||||
* If *REDIR is not null, recognize redirection syntax, and set *REDIR
|
||||
* to UTF-8 redirection string if present, else NULL.
|
||||
* Return number of slots used in ARG[], or -1 on error.
|
||||
*/
|
||||
int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue