Changeset 55e35a22 in mainline
- Timestamp:
- 2018-11-30T04:19:33Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 229d114e
- Parents:
- 4bf08aa5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/input.c
r4bf08aa5 r55e35a22 43 43 #include <stdbool.h> 44 44 #include <tinput.h> 45 #include <adt/odict.h> 45 46 46 47 #include "config.h" … … 173 174 174 175 175 /* test if the passed cmd is an alias 176 odlink_t *alias_link = odict_find_eq(&alias_dict, (void *)&v, NULL);177 e = odict_get_instance(alias_link, test_entry_t, alias_dict);178 if() {176 /* test if the passed cmd is an alias */ 177 odlink_t* alias_link = odict_find_eq(&alias_dict, (void*)cmd[0], NULL); 178 if (alias_link != NULL) { 179 alias_t* data = odict_get_instance(alias_link, alias_t, odict); 179 180 char* oldLine = usr->line; 180 181 182 183 const size_t input_length = str_size(usr->line) - str_size(cmd[0]) + str_size(data->value) + 1; 184 usr->line = (char*)malloc(INPUT_MAX * sizeof(char)); 185 usr->line[0] = '\0'; 186 187 unsigned int cmd_replace_index = cmd_token_start; 188 for (i = 0; i < tokens_length; i++) { 189 if(i == cmd_replace_index) { 190 //if there is a pipe symbol than cmd_token_start will point at the SPACE after the pipe symbol 191 if(tokens[i].type == TOKTYPE_SPACE) { 192 cmd_replace_index++; 193 str_append(usr->line, input_length, tokens[i].text); 194 continue; 195 } 196 197 str_append(usr->line, input_length, data->value); 198 }else { 199 str_append(usr->line, input_length, tokens[i].text); 200 } 201 } 181 202 182 203 //reprocess input after string replace … … 185 206 goto finit; 186 207 } 187 188 */189 208 190 209
Note:
See TracChangeset
for help on using the changeset viewer.