[02/14] cmdline: fix whitespace
Checks
Commit Message
Add space after keywords.
Remove unnecessary spaces in if expressions.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/cmdline/cmdline_parse_string.c | 10 +++++-----
lib/cmdline/cmdline_rdline.c | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
@@ -77,16 +77,16 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
continue;
}
- if ( strncmp(buf, str, token_len) ) {
+ if (strncmp(buf, str, token_len)) {
continue;
}
- if ( !cmdline_isendoftoken(*(buf+token_len)) ) {
+ if (!cmdline_isendoftoken(*(buf+token_len))) {
continue;
}
break;
- } while ( (str = get_next_token(str)) != NULL );
+ } while ( (str = get_next_token(str)) != NULL);
if (!str)
return -1;
@@ -108,7 +108,7 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
/* unspecified string (unknown single token) */
else {
token_len = 0;
- while(!cmdline_isendoftoken(buf[token_len]) &&
+ while (!cmdline_isendoftoken(buf[token_len]) &&
token_len < (STR_TOKEN_SIZE-1))
token_len++;
@@ -149,7 +149,7 @@ int cmdline_complete_get_nb_string(cmdline_parse_token_hdr_t *tk)
return 0;
str = sd->str;
- while( (str = get_next_token(str)) != NULL ) {
+ while ((str = get_next_token(str)) != NULL) {
ret++;
}
return ret;
@@ -301,7 +301,7 @@ rdline_char_in(struct rdline *rdl, char c)
/* delete 1 char from the left */
case CMDLINE_KEY_BKSPACE:
case CMDLINE_KEY_BKSPACE2:
- if(!cirbuf_del_tail_safe(&rdl->left)) {
+ if (!cirbuf_del_tail_safe(&rdl->left)) {
rdline_puts(rdl, vt100_bs);
display_right_buffer(rdl, 1);
}
@@ -354,7 +354,7 @@ rdline_char_in(struct rdline *rdl, char c)
/* paste contents of kill buffer to the left side of caret */
case CMDLINE_KEY_CTRL_Y:
i=0;
- while(CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
+ while (CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
RDLINE_BUF_SIZE &&
i < rdl->kill_size) {
cirbuf_add_tail(&rdl->left, rdl->kill_buf[i]);
@@ -404,7 +404,7 @@ rdline_char_in(struct rdline *rdl, char c)
/* add chars */
if (ret == RDLINE_RES_COMPLETE) {
i=0;
- while(CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
+ while (CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) <
RDLINE_BUF_SIZE &&
i < tmp_size) {
cirbuf_add_tail(&rdl->left, tmp_buf[i]);