Changeset 87eba56 in mainline for uspace/app/bdsh/input.c


Ignore:
Timestamp:
2021-08-10T21:11:01Z (3 years ago)
Author:
Manuele Conti <manuele.conti@…>
Children:
5ec0e42
Parents:
4518991
Message:

Fix tokenize command

File:
1 edited

Legend:

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

    r4518991 r87eba56  
    193193
    194194        cmd_argc = tokens_length;
     195        unsigned wait_from = 0;
     196        unsigned wait_to = 0;
    195197        for (i = 0, pipe_count = 0; i < tokens_length; i++) {
    196198                switch (tokens[i].type) {
     
    202204
    203205                case TOKTYPE_RDIN:
    204                         redir_from = tokens[i + 1].text;
     206                        wait_from = 1;
    205207                        cmd_argc = i;
    206208                        break;
    207209
    208210                case TOKTYPE_RDOU:
    209                         redir_to = tokens[i + 1].text;
     211                        wait_to = 1;
    210212                        cmd_argc = i;
     213                        break;
     214
     215                case TOKTYPE_TEXT:
     216                        if (wait_from) {
     217                                redir_from = tokens[i].text;
     218                                wait_from = 0;
     219                        }
     220                        if (wait_to) {
     221                                redir_to = tokens[i].text;
     222                                wait_to = 0;
     223                        }
    211224                        break;
    212225
Note: See TracChangeset for help on using the changeset viewer.