OSSP CVS Repository

ossp - Difference in ossp-pkg/var/var.c versions 1.63 and 1.64
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/var/var.c 1.63 -> 1.64

--- var.c        2002/02/28 08:48:44     1.63
+++ var.c        2002/02/28 09:29:48     1.64
@@ -653,8 +653,21 @@
        do. */
 
     if (name.begin == name.end) {
-        rc = VAR_ERR_INCOMPLETE_VARIABLE_SPEC;
-        goto error_return;
+        if (force_expand) {
+            rc = VAR_ERR_INCOMPLETE_VARIABLE_SPEC;
+            goto error_return;
+        }
+        else {
+            /* If no force_expand is requested, we have to back-off.
+               We're not sure whether our approach here is 100% correct,
+               because it _could_ have side-effects according to Peter
+               Simons, but as far as we know and tried it, it is
+               correct. But be warned -- RSE */
+            result->begin = begin - 1;
+            result->end = p;
+            result->buffer_size = 0;
+            goto goahead;
+        }
     }
 
     /* If the next token is START-INDEX, read the index specification. */
@@ -725,6 +738,7 @@
         }
     }
 
+    goahead:
     if (p[-1] == ':') {
         /* Parse and execute commands. */
 

CVSTrac 2.0.1