Ignore:
Timestamp:
2012-05-04T11:40:50Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
738b549
Parents:
35a35651
Message:

Use bool and more descriptive variable names

File:
1 edited

Legend:

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

    r35a35651 rb00255a  
    8383/* This is kind of clunky, but effective for now */
    8484static unsigned int
    85 create_directory(const char *path, unsigned int p)
     85create_directory(const char *path, bool create_parents)
    8686{
    8787        DIR *dirp;
     
    107107
    108108        /* Typical use without specifying the creation of parents */
    109         if (p == 0) {
     109        if (!create_parents) {
    110110                dirp = opendir(tmp);
    111111                if (dirp) {
     
    182182int cmd_mkdir(char **argv)
    183183{
    184         unsigned int argc, create_parents = 0, i, ret = 0, follow = 0;
    185         unsigned int verbose = 0;
     184        unsigned int argc, i, ret = 0;
     185        bool create_parents = false, follow = false, verbose = false;
    186186        int c, opt_ind;
    187187        char *cwd;
     
    193193                switch (c) {
    194194                case 'p':
    195                         create_parents = 1;
     195                        create_parents = true;
    196196                        break;
    197197                case 'v':
    198                         verbose = 1;
     198                        verbose = true;
    199199                        break;
    200200                case 'h':
     
    205205                        return CMD_SUCCESS;
    206206                case 'f':
    207                         follow = 1;
     207                        follow = true;
    208208                        break;
    209209                case 'm':
     
    230230
    231231        for (i = optind; argv[i] != NULL; i++) {
    232                 if (verbose == 1)
     232                if (verbose)
    233233                        printf("%s: creating %s%s\n",
    234234                                cmdname, argv[i],
     
    237237        }
    238238
    239         if (follow == 0)
     239        if (follow)
    240240                chdir(cwd);
    241241
Note: See TracChangeset for help on using the changeset viewer.