Changeset d752cf4 in mainline for uspace/app/bdsh/input.c


Ignore:
Timestamp:
2009-01-22T07:13:13Z (15 years ago)
Author:
Tim Post <echo@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
491af07
Parents:
48c3d50
Message:

Eliminate 'restrict' from command structure, get rid of needless aliases.
Order of search is builtin → module → external, there is no need to
restrict commands to (non)interative shells only any longer.

File:
1 edited

Legend:

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

    r48c3d50 rd752cf4  
    7373        tmp = cli_strdup(usr->line);
    7474
    75         /* Break up what the user typed, space delimited */
    76 
    77         /* TODO: Protect things in quotes / ticks, expand wildcards */
    7875        cmd[n] = cli_strtok(tmp, " ");
    7976        while (cmd[n] && n < WORD_MAX) {
     
    8784        }
    8885
    89         /* Its a builtin command */
     86        /* Its a builtin command ? */
    9087        if ((i = (is_builtin(cmd[0]))) > -1) {
    91                 /* Its not available in this mode, see what try_exec() thinks */
    92                 if (builtin_is_restricted(i)) {
    93                                 rc = try_exec(cmd[0], cmd);
    94                                 if (rc)
    95                                         /* No external matching it could be found, tell the
    96                                          * user that the command does exist, but is not
    97                                          * available in this mode. */
    98                                         cli_restricted(cmd[0]);
    99                                 goto finit;
    100                 }
    101                 /* Its a builtin, its available, run it */
    10288                rc = run_builtin(i, cmd, usr);
    10389                goto finit;
    104         /* We repeat the same dance for modules */
     90        /* Its a module ? */
    10591        } else if ((i = (is_module(cmd[0]))) > -1) {
    106                 if (module_is_restricted(i)) {
    107                         rc = try_exec(cmd[0], cmd);
    108                         if (rc)
    109                                 cli_restricted(cmd[0]);
    110                         goto finit;
    111                 }
    11292                rc = run_module(i, cmd);
    11393                goto finit;
    114         } else {
    115                 /* Its not a module or builtin, restricted or otherwise.
    116                  * See what try_exec() thinks of it and just pass its return
    117                  * value back to the caller */
    118                 rc = try_exec(cmd[0], cmd);
    119                 goto finit;
    12094        }
     95
     96        /* See what try_exec thinks of it */
     97        rc = try_exec(cmd[0], cmd);
    12198
    12299finit:
Note: See TracChangeset for help on using the changeset viewer.