Author: adrian.chadd
Date: Thu May 21 01:53:22 2009
New Revision: 14058

Modified:
    branches/LUSCA_HEAD/libmem/StrList.c

Log:
Modify the strList function to use strIsNull() rather than directly
checking whether the backing value is NULL.

(This is preparation work for reference counted strings.)



Modified: branches/LUSCA_HEAD/libmem/StrList.c
==============================================================================
--- branches/LUSCA_HEAD/libmem/StrList.c        (original)
+++ branches/LUSCA_HEAD/libmem/StrList.c        Thu May 21 01:53:22 2009
@@ -196,9 +196,11 @@
      delim[2][1] = del;
      assert(str && item && pos);
      if (!*pos) {
-       *pos = strBuf(*str);
-       if (!*pos)
-           return 0;
+         if (strIsNull(*str)) {
+            *pos = NULL;               /* The previous code had this as a side 
effect.. */
+             return 0;
+        }
+         *pos = strBuf(*str);          /* The rest of this routine still 
assumes C  
string semantics. */
      }
      /* skip leading whitespace and delimiters */
      *pos += strspn(*pos, delim[2]);

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to