Changeset 8565a42 in mainline for uspace/app/bdsh/cmds/modules


Ignore:
Timestamp:
2018-03-02T20:34:50Z (8 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.

Location:
uspace/app/bdsh/cmds/modules
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    r3061bc1 r8565a42  
    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);
  • uspace/app/bdsh/cmds/modules/cmp/cmp.c

    r3061bc1 r8565a42  
    120120        unsigned int argc;
    121121        int c, opt_ind;
    122        
     122
    123123        argc = cli_count_args(argv);
    124124
  • uspace/app/bdsh/cmds/modules/cp/cp.c

    r3061bc1 r8565a42  
    196196                str_cpy(src_path, src_len + 1, src);
    197197                str_rtrim(src_path, '/');
    198                
     198
    199199                /* Get the last component name from the src path */
    200200                src_fname = get_last_path_component(src_path);
    201                
     201
    202202                /* Initialize dest_path with the dest argument */
    203203                str_cpy(dest_path, PATH_MAX, dest);
     
    206206                        /* e.g. cp file_name /data */
    207207                        /* e.g. cp file_name /data/ */
    208                        
     208
    209209                        /* dest is a directory,
    210210                         * append the src filename to it.
  • uspace/app/bdsh/cmds/modules/kcon/kcon.c

    r3061bc1 r8565a42  
    4343{
    4444        printf("`kcon' switches to the kernel debug console.\n");
    45        
     45
    4646        if (level != HELP_SHORT)
    4747                printf("Usage: %s\n", cmdname);
    48        
     48
    4949        return;
    5050}
     
    5454{
    5555        unsigned int argc = cli_count_args(argv);
    56        
     56
    5757        if (argc != 1) {
    5858                printf("%s - incorrect number of arguments. Try `%s --help'\n",
     
    6060                return CMD_FAILURE;
    6161        }
    62        
     62
    6363        if (console_kcon())
    6464                return CMD_SUCCESS;
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    r3061bc1 r8565a42  
    111111        struct dir_elem_t const *da = a;
    112112        struct dir_elem_t const *db = b;
    113        
     113
    114114        if ((da->s.is_directory && db->s.is_file) ||
    115115            ((da->s.is_directory == db->s.is_directory) &&
     
    141141        struct dir_elem_t *tosort;
    142142        struct dirent *dp;
    143        
     143
    144144        if (!dirp)
    145145                return -1;
     
    150150                return -1;
    151151        }
    152        
     152
    153153        tosort = (struct dir_elem_t *) malloc(alloc_blocks * sizeof(*tosort));
    154154        if (!tosort) {
     
    157157                return -1;
    158158        }
    159        
     159
    160160        while ((dp = readdir(dirp))) {
    161161                if (nbdirs + 1 > alloc_blocks) {
    162162                        alloc_blocks += alloc_blocks;
    163                        
     163
    164164                        tmp = (struct dir_elem_t *) realloc(tosort,
    165165                            alloc_blocks * sizeof(struct dir_elem_t));
     
    170170                        tosort = tmp;
    171171                }
    172                
     172
    173173                /* fill the name field */
    174174                tosort[nbdirs].name = (char *) malloc(str_size(dp->d_name) + 1);
     
    189189                }
    190190        }
    191        
     191
    192192        if (ls.sort)
    193193                qsort(&tosort[0], nbdirs, sizeof(struct dir_elem_t), ls_cmp);
    194        
     194
    195195        for (i = 0; i < nbdirs; i++)
    196196                ls_print(&tosort[i]);
     
    214214                }
    215215        }
    216        
     216
    217217out:
    218218        for(i = 0; i < nbdirs; i++)
     
    239239        DIR *subdirp;
    240240        struct dir_elem_t *dir_list;
    241        
     241
    242242        const char * const trailing_slash = "/";
    243243
     
    294294                }
    295295        }
    296    
     296
    297297        ret = CMD_SUCCESS;
    298298
     
    355355
    356356        argc = cli_count_args(argv);
    357        
     357
    358358        for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
    359359                c = getopt_long(argc, argv, "hur", long_options, &opt_ind);
  • uspace/app/bdsh/cmds/modules/mkfile/mkfile.c

    r3061bc1 r8565a42  
    171171        if (create_sparse && file_size > 0) {
    172172                const char byte = 0x00;
    173                
     173
    174174                pos = file_size - 1;
    175175                rc = vfs_write(fd, &pos, &byte, sizeof(char), &nwritten);
  • uspace/app/bdsh/cmds/modules/printf/TODO

    r3061bc1 r8565a42  
    1111 * Add width/precision options for number printings
    1212 * Add more format flags (%f %b ...)
    13  
  • uspace/app/bdsh/cmds/modules/printf/printf.c

    r3061bc1 r8565a42  
    5555        }
    5656
    57        
     57
    5858        return;
    5959}
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    r3061bc1 r8565a42  
    189189
    190190        closedir(dirp);
    191        
     191
    192192        return ret;
    193193}
  • uspace/app/bdsh/cmds/modules/touch/touch.c

    r3061bc1 r8565a42  
    6969                    cmdname);
    7070        }
    71        
     71
    7272        return;
    7373}
     
    8585        int fd = -1;
    8686        char *buff = NULL;
    87        
     87
    8888        DIR *dirp;
    89        
     89
    9090        for (c = 0, optreset = 1, optind = 0, longind = 0; c != -1; ) {
    9191                c = getopt_long(argc, argv, "c", long_options, &longind);
     
    9696                }
    9797        }
    98        
     98
    9999        if (argc - optind < 1) {
    100100                printf("%s: Incorrect number of arguments. Try `help %s extended'\n",
     
    102102                return CMD_FAILURE;
    103103        }
    104        
     104
    105105        for (i = optind; argv[i] != NULL; i++) {
    106106                buff = str_dup(argv[i]);
     
    110110                        continue;
    111111                }
    112                
     112
    113113                dirp = opendir(buff);
    114114                if (dirp) {
     
    119119                        continue;
    120120                }
    121                
     121
    122122                /* Check whether file exists if -c (--no-create) option is given */
    123123                if ((!no_create) ||
     
    128128                        }
    129129                }
    130                
     130
    131131                if (fd < 0) {
    132132                        cli_error(CL_EFAIL, "Could not update or create `%s'", buff);
     
    138138                        fd = -1;
    139139                }
    140                
     140
    141141                free(buff);
    142142        }
    143        
     143
    144144        if (ret)
    145145                return CMD_FAILURE;
Note: See TracChangeset for help on using the changeset viewer.