Changeset 8565a42 in mainline for uspace/app/bdsh/compl.c


Ignore:
Timestamp:
2018-03-02T20:34:50Z (7 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1a81f69, d5e5fd1
Parents:
3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
git-committer:
GitHub <noreply@…> (2018-03-02 20:34:50)
Message:

Remove all trailing whitespace, everywhere.

See individual commit messages for details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/compl.c

    r3061bc1 r8565a42  
    9595        char *dirname = NULL;
    9696        errno_t retval;
    97        
     97
    9898        token_t *tokens = calloc(WORD_MAX, sizeof(token_t));
    9999        if (tokens == NULL) {
     
    101101                goto error;
    102102        }
    103        
     103
    104104        size_t pref_size;
    105105        char *rpath_sep;
     
    108108        ssize_t current_token;
    109109        size_t tokens_length;
    110        
     110
    111111        cs = calloc(1, sizeof(compl_t));
    112112        if (!cs) {
     
    114114                goto error;
    115115        }
    116        
     116
    117117        /* Convert text buffer to string */
    118118        stext = wstr_to_astr(text);
     
    121121                goto error;
    122122        }
    123        
     123
    124124        /* Tokenize the input string */
    125125        retval = tok_init(&tok, stext, tokens, WORD_MAX);
     
    127127                goto error;
    128128        }
    129        
     129
    130130        retval = tok_tokenize(&tok, &tokens_length);
    131131        if (retval != EOK) {
    132132                goto error;
    133133        }
    134        
     134
    135135        /* Find the current token */
    136136        for (current_token = 0; current_token < (ssize_t) tokens_length;
     
    138138                token_t *t = &tokens[current_token];
    139139                size_t end = t->char_start + t->char_length;
    140                
     140
    141141                /*
    142142                 * Check if the caret lies inside the token or immediately
     
    147147                }
    148148        }
    149        
     149
    150150        if (tokens_length == 0)
    151151                current_token = -1;
    152        
     152
    153153        if ((current_token >= 0) && (tokens[current_token].type != TOKTYPE_SPACE))
    154154                *cstart = tokens[current_token].char_start;
    155155        else
    156156                *cstart = pos;
    157        
     157
    158158        /*
    159159         * Extract the prefix being completed
     
    183183        if ((prev_token >= 0) && (tokens[prev_token].type == TOKTYPE_SPACE))
    184184                prev_token--;
    185        
     185
    186186        /*
    187187         * It is a command if it is the first token or if it immediately
     
    236236
    237237        cs->prefix_len = str_length(cs->prefix);
    238        
     238
    239239        tok_fini(&tok);
    240240
     
    244244error:
    245245        /* Error cleanup */
    246        
     246
    247247        tok_fini(&tok);
    248248
     
    258258        if ((cs != NULL) && (cs->prefix != NULL))
    259259                free(cs->prefix);
    260        
     260
    261261        if (dirname != NULL)
    262262                free(dirname);
    263        
     263
    264264        if (prefix != NULL)
    265265                free(prefix);
    266        
     266
    267267        if (stext != NULL)
    268268                free(stext);
    269        
     269
    270270        if (cs != NULL)
    271271                free(cs);
    272        
     272
    273273        if (tokens != NULL)
    274274                free(tokens);
Note: See TracChangeset for help on using the changeset viewer.