diff options
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | hash.c | 4 | ||||
| -rw-r--r-- | main.c | 5 | ||||
| -rw-r--r-- | rc.1 | 18 | ||||
| -rw-r--r-- | var.c | 5 |
5 files changed, 18 insertions, 20 deletions
@@ -769,6 +769,8 @@ Changes since rc-1.5b2 Release: rc-1.6c6. -2002-03-27 +2002-04-03 - Feature: rename $version to $rc_version. + Feature: make $version less magical, and exportable. + + Bug: make $bqstatus and $status not exportable. @@ -230,8 +230,8 @@ extern void initenv(char **envp) { static bool var_exportable(char *s) { static char *notforexport[] = { - "apid", "apids", "cdpath", "home", "ifs", - "path", "pid", "version", "*" + "apid", "apids", "bqstatus", "cdpath", "home", "ifs", + "path", "pid", "status", "*" }; int i; for (i = 0; i < arraysize(notforexport); i++) @@ -74,12 +74,13 @@ quitopts: initsignal(); inithash(); initparse(); - assigndefault("prompt", "; ", "", (void *)0); + assigndefault("ifs", " ", "\t", "\n", (void *)0); #ifdef DEFAULTPATH assigndefault("path", DEFAULTPATH, (void *)0); #endif - assigndefault("ifs", " ", "\t", "\n", (void *)0); assigndefault("pid", nprint("%d", rc_pid), (void *)0); + assigndefault("prompt", "; ", "", (void *)0); + assigndefault("version", VERSION, "$Release: @(#)" PACKAGE " " VERSION " " RELDATE " $", (void *)0); initenv(envp); initinput(); null[0] = NULL; @@ -1399,15 +1399,6 @@ If this function is defined, then it gets executed every time is about to print .Cr "$prompt(1)" . .TP -.Cr rc_version " (read only)" -The first element of this list variable is a string which identifies this -version of -.IR rc . -The second element is a string which can be found by -.B ident -and -.BR "sccs what" . -.TP .Cr status " (read only)" The exit status of the last command. If the command exited with a numeric value, that number is the status. @@ -1429,6 +1420,15 @@ usually sets .Cr $status to .Cr "(0 0)" . +.TP +.Cr version +The first element of this list variable is a string which identifies this +version of +.IR rc . +The second element is a string which can be found by +.B ident +and +.BR "sccs what" . .PP The values of .Cr "$path" , @@ -57,9 +57,6 @@ extern bool varassign_string(char *extdef) { associated with $status) */ -static List id2 = { "$Release: @(#)" PACKAGE " " VERSION " " RELDATE " $", 0, 0 }; -static List id1 = { VERSION, 0, &id2 }; - extern List *varlookup(char *name) { Variable *look; List *ret, *l; @@ -68,8 +65,6 @@ extern List *varlookup(char *name) { return sgetapids(); if (streq(name, "status")) return sgetstatus(); - if (streq(name, "rc_version")) - return &id1; if (*name != '\0' && (sub = a2u(name)) != -1) { /* handle $1, $2, etc. */ for (l = varlookup("*"); l != NULL && sub != 0; --sub) l = l->n; |