Changeset 287 for trunk/src/gmake/variable.c
- Timestamp:
- May 17, 2005, 1:34:55 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/variable.c
r225 r287 500 500 501 501 do 502 /* We found one, so insert it into the set. */ 503 do_variable_definition (&p->variable.fileinfo, p->variable.name, 504 p->variable.value, p->variable.origin, 505 p->variable.flavor, 1); 502 { 503 /* We found one, so insert it into the set. */ 504 505 struct variable *v; 506 507 if (p->variable.flavor == f_simple) 508 { 509 v = define_variable_loc ( 510 p->variable.name, strlen (p->variable.name), 511 p->variable.value, p->variable.origin, 512 0, &p->variable.fileinfo); 513 514 v->flavor = f_simple; 515 } 516 else 517 { 518 v = do_variable_definition ( 519 &p->variable.fileinfo, p->variable.name, 520 p->variable.value, p->variable.origin, 521 p->variable.flavor, 1); 522 } 523 524 /* Also mark it as a per-target and copy export status. */ 525 v->per_target = p->variable.per_target; 526 v->export = p->variable.export; 527 } 506 528 while ((p = lookup_pattern_var (p, file->name)) != 0); 507 529 … … 735 757 #endif 736 758 737 /* This won't override any definition, but it 738 will provide one if thereisn't one there. */759 /* This won't override any definition, but it will provide one if there 760 isn't one there. */ 739 761 v = define_variable ("SHELL", 5, default_shell, o_default, 0); 740 v->export = v_export; /* Always export SHELL. */ 741 742 /* On MSDOS we do use SHELL from environment, since 743 it isn't a standard environment variable on MSDOS, 744 so whoever sets it, does that on purpose. 745 On OS/2 we do not use SHELL from environment but 746 we have already handled that problem above. */ 762 763 /* On MSDOS we do use SHELL from environment, since it isn't a standard 764 environment variable on MSDOS, so whoever sets it, does that on purpose. 765 On OS/2 we do not use SHELL from environment but we have already handled 766 that problem above. */ 747 767 #if !defined(__MSDOS__) && !defined(__EMX__) 748 768 /* Don't let SHELL come from the environment. */ … … 862 882 863 883 case v_noexport: 864 continue; 884 /* If this is the SHELL variable and it's not exported, then 885 add the value from our original environment. */ 886 if (streq (v->name, "SHELL")) 887 { 888 extern struct variable shell_var; 889 v = &shell_var; 890 break; 891 } 892 continue; 865 893 866 894 case v_ifset: … … 977 1005 v = lookup_variable_in_set (varname, strlen (varname), 978 1006 current_variable_set_list->set); 1007 1008 /* Don't append from the global set if a previous non-appending 1009 target-specific variable definition exists. */ 1010 if (v && !v->append) 1011 append = 0; 979 1012 } 980 1013 else … … 1035 1068 && strcmp (varname, "SHELL") == 0) 1036 1069 { 1037 char shellpath[PATH_MAX];1070 PATH_VAR (shellpath); 1038 1071 extern char * __dosexec_find_on_path (const char *, char *[], char *); 1039 1072 … … 1420 1453 sync_Path_environment (void) 1421 1454 { 1422 char *path = allocated_variable_expand ("$(P ath)");1455 char *path = allocated_variable_expand ("$(PATH)"); 1423 1456 static char *environ_path = NULL; 1424 1457 … … 1437 1470 */ 1438 1471 convert_Path_to_windows32 (path, ';'); 1439 environ_path = concat ("P ath", "=", path);1472 environ_path = concat ("PATH", "=", path); 1440 1473 putenv (environ_path); 1441 1474 free (path);
Note:
See TracChangeset
for help on using the changeset viewer.