OSSP CVS Repository

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

ossp-pkg/var/var.c 1.22 -> 1.23

--- var.c        2001/11/19 15:15:31     1.22
+++ var.c        2001/11/19 15:56:17     1.23
@@ -615,25 +615,22 @@
     rc = varname(p, end, nameclass);
     if (rc < 0)
         return rc;
-    else if (rc > 0) {
+    if (rc > 0) {
         rc2 = (*lookup) (lookup_context, p, rc, &data, &len, &buffer_size);
         if (rc2 < 0)
             return rc2;
-        else if (rc2 == 0) {
+        if (rc2 == 0) {
             if (force_expand)
                 return VAR_ERR_UNDEFINED_VARIABLE;
-            else {
-                result->begin = begin;
-                result->end = begin + 1 + rc;
-                result->buffer_size = 0;
-                return 1 + rc;
-            }
-        } else {
-            result->begin = data;
-            result->end = data + len;
-            result->buffer_size = buffer_size;
+            result->begin = begin;
+            result->end = begin + 1 + rc;
+            result->buffer_size = 0;
             return 1 + rc;
         }
+        result->begin = data;
+        result->end = data + len;
+        result->buffer_size = buffer_size;
+        return 1 + rc;
     }
 
     /* OK, we're dealing with a complex expression here. */
@@ -1536,9 +1533,10 @@
                 (output, result.begin, result.end - result.begin)) {
                 rc = VAR_ERR_OUT_OF_MEMORY;
                 goto error_return;
-            } else
-                begin += rc;
-        } else if (rc < 0)
+            }
+            begin += rc;
+        }
+        if (rc < 0)
             goto error_return;
     }
     while (rc > 0);
@@ -1591,9 +1589,12 @@
     if (nameclass[(int)config->varinit] ||
         nameclass[(int)config->startdelim] ||
         nameclass[(int)config->enddelim] ||
+//FIXME THL: if(config->varinit == ':' ...any must not be colon > ERROR, varname() will fail
         nameclass[(int)config->escape])
         return VAR_ERR_INVALID_CONFIGURATION;
 
+//FIXME THL: if(config->varinit == config->startdelimit || ...any with any...
+
     /* Call the parser. */
     tokenbuf_init(&output);
     rc = input(input_buf, input_buf + input_len, config, nameclass,

CVSTrac 2.0.1