From 6a5377ac14bec2f2ae62c4ec085ff3b149cc11ad Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 25 Sep 2007 18:35:28 +0000 Subject: [PATCH] documentation bits in comments, no code changes --- editors/ed.c | 2 -- include/libbb.h | 6 ++++++ libbb/lineedit.c | 5 +++++ libbb/skip_whitespace.c | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/editors/ed.c b/editors/ed.c index f5b9c39bb..cd3836aed 100644 --- a/editors/ed.c +++ b/editors/ed.c @@ -82,7 +82,6 @@ static int bad_nums(int num1, int num2, const char *for_what) static char *skip_blank(const char *cp) { -// NB: fix comment in skip_whitespace! while (isblank(*cp)) cp++; return (char *)cp; @@ -125,7 +124,6 @@ static void doCommands(void) smallint have1, have2; while (TRUE) { -// NB: fix comment in lineedit.c! /* Returns: * -1 on read errors or EOF, or on bare Ctrl-D. * 0 on ctrl-C, diff --git a/include/libbb.h b/include/libbb.h index 25b2e4489..407b723b2 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -892,6 +892,12 @@ enum { FOR_SHELL = DO_HISTORY | SAVE_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION, }; line_input_t *new_line_input_t(int flags); +/* Returns: + * -1 on read errors or EOF, or on bare Ctrl-D. + * 0 on ctrl-C, + * >0 length of input string, including terminating '\n' + * [is this true? stores "" in 'command' if return value is 0 or -1] + */ int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *state); #else int read_line_input(const char* prompt, char* command, int maxsize); diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 62f8949d6..a018a53ff 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -1253,6 +1253,11 @@ static void win_changed(int nsig) #undef CTRL #define CTRL(a) ((a) & ~0x40) +/* Returns: + * -1 on read errors or EOF, or on bare Ctrl-D. + * 0 on ctrl-C, + * >0 length of input string, including terminating '\n' + */ int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *st) { int lastWasTab = FALSE; diff --git a/libbb/skip_whitespace.c b/libbb/skip_whitespace.c index bdfb97d70..87b5f23ba 100644 --- a/libbb/skip_whitespace.c +++ b/libbb/skip_whitespace.c @@ -11,7 +11,7 @@ char *skip_whitespace(const char *s) { - /* NB: isspace('0') returns 0 */ + /* NB: isspace('\0') returns 0 */ while (isspace(*s)) ++s; return (char *) s; -- 2.25.1