Changeset a35b458 in mainline for uspace/lib/posix/src/fnmatch.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/src/fnmatch.c

    r3061bc1 ra35b458  
    301301                return COLL_ELM_INVALID;
    302302        }
    303        
     303
    304304        *pattern = p + 1;
    305305        return _coll_elm_char(*p);
     
    359359                p++;
    360360        }
    361        
     361
    362362        coll_elm_t current_elm = COLL_ELM_INVALID;
    363        
     363
    364364        while (*p != ']') {
    365365                if (*p == '-' && *(p + 1) != ']' &&
     
    374374                        continue;
    375375                }
    376        
     376
    377377                if (*p == '[' && *(p + 1) == ':') {
    378378                        current_elm = COLL_ELM_INVALID;
     
    380380                        continue;
    381381                }
    382                
     382
    383383                current_elm = _next_coll_elm(&p, flags);
    384384                if (current_elm == COLL_ELM_INVALID) {
     
    460460                                return false;
    461461                        }
    462                        
     462
    463463                        /* None of the above, match anything else. */
    464464                        p++;
     
    496496
    497497        /* Entire sub-pattern matched. */
    498        
     498
    499499        /* postconditions */
    500500        assert(*p == '\0' || *p == '*');
    501501        assert(*p != '\0' || *s == '\0' || (leading_dir && *s == '/'));
    502        
     502
    503503        *pattern = p;
    504504        *string = s;
     
    667667        match("helen??", "helenos", 0);
    668668        match("****booo****", "booo", 0);
    669        
     669
    670670        match("hello[[:space:]]world", "hello world", 0);
    671671        nomatch("hello[[:alpha:]]world", "hello world", 0);
    672        
     672
    673673        match("/hoooo*", "/hooooooo/hooo", 0);
    674674        nomatch("/hoooo*", "/hooooooo/hooo", FNM_PATHNAME);
     
    680680        nomatch("/hoooo", "/hooooooo/hooo", FNM_LEADING_DIR);
    681681        match("/hooooooo", "/hooooooo/hooo", FNM_LEADING_DIR);
    682        
     682
    683683        match("*", "hell", 0);
    684684        match("*?", "hell", 0);
     
    687687        match("??*??", "hell", 0);
    688688        nomatch("???*??", "hell", 0);
    689        
     689
    690690        nomatch("", "hell", 0);
    691691        nomatch("?", "hell", 0);
     
    693693        nomatch("???", "hell", 0);
    694694        match("????", "hell", 0);
    695        
     695
    696696        match("*", "h.ello", FNM_PERIOD);
    697697        match("*", "h.ello", FNM_PATHNAME | FNM_PERIOD);
Note: See TracChangeset for help on using the changeset viewer.