VirtualBox

Changeset 1458 in kBuild


Ignore:
Timestamp:
Mar 30, 2008 10:16:15 PM (17 years ago)
Author:
bird
Message:

Use the variable file location in evalval and evalcall.

Location:
trunk/src/kmk
Files:
2 edited

Legend:

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

    r1440 r1458  
    518518  char *result;
    519519  struct variable_set_list *save;
     520  const struct floc *reading_file_saved;
    520521
    521522  if (file == 0)
     
    524525  save = current_variable_set_list;
    525526  current_variable_set_list = file->variables;
     527  reading_file_saved = reading_file;
    526528  if (file->cmds && file->cmds->fileinfo.filenm)
    527529    reading_file = &file->cmds->fileinfo;
     
    530532  result = variable_expand_string (o, line, (long)-1);
    531533  current_variable_set_list = save;
    532   reading_file = 0;
     534  reading_file = reading_file_saved;
    533535
    534536  return result;
  • trunk/src/kmk/function.c

    r1452 r1458  
    15521552      int var_ctx;
    15531553      size_t off;
     1554      const struct floc *reading_file_saved = reading_file;
    15541555
    15551556      /* Make a copy of the value to the variable buffer since
     
    15681569      if (var_ctx)
    15691570        push_new_variable_scope ();
     1571      if (v->fileinfo.filenm)
     1572        reading_file = &v->fileinfo;
    15701573
    15711574      eval_buffer (o);
    15721575
     1576      reading_file = reading_file_saved;
    15731577      if (var_ctx)
    15741578        pop_variable_scope ();
     
    41974201  else
    41984202    {
     4203      const struct floc *reading_file_saved = reading_file;
     4204
    41994205      if (!strcmp (funcname, "evalcall"))
    42004206        {
     
    42054211          o = variable_buffer_output (o, v->value, v->value_length + 1);
    42064212          o = variable_buffer + off;
     4213          if (v->fileinfo.filenm)
     4214            reading_file = &v->fileinfo;
    42074215        }
    42084216      else
     
    42184226      eval_buffer (o);
    42194227      restore_variable_buffer (buf, len);
     4228      reading_file = reading_file_saved;
    42204229    }
    42214230#endif /* CONFIG_WITH_EVALPLUS */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette