Changeset a35b458 in mainline for uspace/app/bdsh/cmds/modules/cat


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/app/bdsh/cmds/modules/cat/cat.c

    r3061bc1 ra35b458  
    110110        console_set_pos(console, 0, console_rows-1);
    111111        console_set_color(console, COLOR_WHITE, COLOR_BLUE, 0);
    112        
     112
    113113        printf("ENTER/SPACE/PAGE DOWN - next page, "
    114114               "ESC/Q - quit, C - continue unpaged");
    115115        fflush(stdout);
    116        
     116
    117117        console_set_style(console, STYLE_NORMAL);
    118118}
     
    122122        cons_event_t ev;
    123123        kbd_event_t *kev;
    124        
     124
    125125        while (true) {
    126126                if (!console_get_event(console, &ev)) {
     
    129129                if (ev.type == CEV_KEY && ev.ev.key.type == KEY_PRESS) {
    130130                        kev = &ev.ev.key;
    131                        
     131
    132132                        if (kev->key == KC_ESCAPE || kev->key == KC_Q) {
    133133                                should_quit = true;
     
    190190
    191191        bool reading_stdin = dash_represents_stdin && (str_cmp(fname, "-") == 0);
    192        
     192
    193193        if (reading_stdin) {
    194194                fd = fileno(stdin);
     
    201201                }
    202202        }
    203        
     203
    204204        if (fd < 0) {
    205205                printf("Unable to open %s\n", fname);
     
    255255                        }
    256256                }
    257                
     257
    258258                rc = vfs_read(fd, &pos, buff + copied_bytes, bytes_to_read,
    259259                    &bytes);
     
    283283                                        paged_char(c);
    284284                                }
    285                                
     285
    286286                        }
    287287                        count += bytes;
    288288                        reads++;
    289289                }
    290                
     290
    291291                if (reading_stdin)
    292292                        fflush(stdout);
     
    317317        sysarg_t rows, cols;
    318318        errno_t rc;
    319        
     319
    320320        /*
    321321         * reset global state
     
    392392        if (buffer < 4)
    393393                buffer = CAT_DEFAULT_BUFLEN;
    394        
     394
    395395        if (more) {
    396396                rc = console_get_size(console, &cols, &rows);
Note: See TracChangeset for help on using the changeset viewer.