Changeset 5f9a52e in mainline
- Timestamp:
 - 2021-08-09T21:42:29Z (4 years ago)
 - Children:
 - 82570ff
 - Parents:
 - 932c640
 - File:
 - 
      
- 1 edited
 
- 
          
  uspace/app/bdsh/input.c (modified) (1 diff)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
uspace/app/bdsh/input.c
r932c640 r5f9a52e 164 164 unsigned int cmd_token_end = cmd_argc; 165 165 166 #if 0167 /* test if the passed cmd is an alias */168 odlink_t *alias_link = odict_find_eq(&alias_dict, (void *)cmd[0], NULL);169 if (alias_link != NULL) {170 alias_t *data = odict_get_instance(alias_link, alias_t, odict);171 /* check if the alias already has been resolved once */172 if (!find_alias_hup(data, alias_hups)) {173 alias_hup_t *hup = (alias_hup_t *)calloc(1, sizeof(alias_hup_t));174 if (hup == NULL) {175 cli_error(CL_EFAIL, "%s: cannot allocate alias structure\n", PACKAGE_NAME);176 rc = ENOMEM;177 goto finit;178 }179 180 hup->alias = data;181 list_append(&hup->alias_hup_link, alias_hups);182 183 char *oldLine = usr->line;184 const size_t input_length = str_size(usr->line) - str_size(cmd[0]) + str_size(data->value) + 1;185 usr->line = (char *)malloc(input_length);186 if (usr->line == NULL) {187 cli_error(CL_EFAIL, "%s: cannot allocate input structure\n", PACKAGE_NAME);188 rc = ENOMEM;189 goto finit;190 }191 192 usr->line[0] = '\0';193 194 unsigned int cmd_replace_index = cmd_token_start;195 for (i = 0; i < tokens_length; i++) {196 if (i == cmd_replace_index) {197 /* if there is a pipe symbol than cmd_token_start will point at the SPACE after the pipe symbol */198 if (tokens[i].type == TOKTYPE_SPACE) {199 cmd_replace_index++;200 str_append(usr->line, input_length, tokens[i].text);201 continue;202 }203 204 str_append(usr->line, input_length, data->value);205 } else {206 str_append(usr->line, input_length, tokens[i].text);207 }208 }209 210 /* reprocess input after string replace */211 rc = process_input_nohup(usr, alias_hups, count_executed_hups + 1);212 usr->line = oldLine;213 goto finit;214 }215 }216 #endif217 218 166 iostate_t new_iostate = { 219 167 .stdin = stdin,  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  