diff --git a/twander.py b/twander.py index 4315f01..01d2bf8 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.127 2003/03/05 23:02:04 tundra Exp $" +RCSID = "$Id: twander.py,v 3.128 2003/03/05 23:38:14 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -570,6 +570,7 @@ REDIRSC = re.compile(reDIRSC) REVAR = re.compile(reVAR) +CONDVAR = re.compile(r'^' + reVAR + r'$') # Built-In Variables @@ -1146,7 +1147,7 @@ # the condition variable has to be in proper variable reference form: [VAR] AND # the rightmost argument cannot be an empty string - if (len(args) != numargs) or (not REVAR.match(args[0].strip())) or (not args[-1]): + if (len(args) != numargs) or (not CONDVAR.match(args[0].strip())) or (not args[-1]): WrnMsg(wBADIF % (num, line)) return @@ -1190,7 +1191,7 @@ else: if var[0] == ENVVBL: - if os.getenv(var[1:]): + if os.environ.has_key(var[1:]): conditional = TRUE elif UI.SymTable.has_key(var): @@ -1236,7 +1237,7 @@ # x =y # x = y - 3 fields # - # But this is not legit: + # But this is illegal # # =....... #