Ignore:
Timestamp:
Mar 30, 2008, 6:13:55 AM (17 years ago)
Author:
bird
Message:

Added comp-cmds-ex, commands, commands-sc and commands-usr. Added a '%' command prefix that make the commands functions skip the line. Added a -c flag to append that'll make it call commands on each argument (similar to -v). Fixed a little bug in comp-cmds/vars.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/expand.c

    r1107 r1440  
    506506
    507507
     508#ifdef CONFIG_WITH_COMMANDS_FUNC
     509/* Expand LINE for FILE.  Error messages refer to the file and line where
     510   FILE's commands were found.  Expansion uses FILE's variable set list.
     511
     512   Differs from variable_expand_for_file in that it takes a pointer to
     513   where in the variable buffer to start outputting the expanded string.  */
     514
     515char *
     516variable_expand_for_file_2 (char *o, const char *line, struct file *file)
     517{
     518  char *result;
     519  struct variable_set_list *save;
     520
     521  if (file == 0)
     522    return variable_expand_string (o, line, (long)-1);
     523
     524  save = current_variable_set_list;
     525  current_variable_set_list = file->variables;
     526  if (file->cmds && file->cmds->fileinfo.filenm)
     527    reading_file = &file->cmds->fileinfo;
     528  else
     529    reading_file = 0;
     530  result = variable_expand_string (o, line, (long)-1);
     531  current_variable_set_list = save;
     532  reading_file = 0;
     533
     534  return result;
     535}
     536
     537
     538#endif /* CONFIG_WITH_COMMANDS_FUNC */
    508539/* Like allocated_variable_expand, but for += target-specific variables.
    509540   First recursively construct the variable value from its appended parts in
Note: See TracChangeset for help on using the changeset viewer.