]> err.no Git - sope/commitdiff
fixed parsing of bool consts (#1360)
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 25 Apr 2005 18:49:52 +0000 (18:49 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 25 Apr 2005 18:49:52 +0000 (18:49 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@774 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/NGObjWeb/ChangeLog
sope-appserver/NGObjWeb/Templates/WODParser.m
sope-appserver/NGObjWeb/Version

index f5f71e60cc87af04abdc703601f4526cd896c2ca..a8d8d288daa5a71724781a458e921e5ae5de9ed4 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-25  Helge Hess  <helge.hess@opengroupware.org>
+
+       * Templates/WODParser.m: fixed parsing of bool constants (got broken in
+         v4.5.152) (OGo bug #1360) (v4.5.156)
+
 2005-04-24  Helge Hess  <helge.hess@opengroupware.org>
 
        * v4.5.155
index 153300d1a83b7a1246333e8fc2375f2e8f1d19c3..a3d3222f5f87b4185f0e7c62e83be9181dd5f883 100644 (file)
@@ -82,13 +82,6 @@ static id _parseWodEntry(NSZone *_zone, const unichar *_buffer, unsigned *_idx,
                          NSString **_name, NSString **_class,
                          id self);
 
-static NSString *_makeStringForBuffer(const unichar *_buf, unsigned _l) {
-  if (_l == 0)
-    return @"";
-
-  return [[StrClass alloc] initWithCharacters:_buf length:_l];
-}
-
 - (NSException *)parseDefinitionsFromBuffer:(const unichar *)_buffer
   length:(unsigned)_len
   mappings:(NSMutableDictionary *)_mappings
@@ -291,8 +284,9 @@ static NSException *_makeException(NSException *_exception,
     
     if (startPos < endPos) {
       NSString *ll;
-
-      ll = _makeStringForBuffer(startPos, endPos - startPos);
+      
+      ll = [[StrClass alloc] initWithCharacters:startPos
+                            length:endPos - startPos];
       [ui setObject:ll forKey:@"lastLine"];
       [ll release];
     }
@@ -413,7 +407,8 @@ static NSString *_parseIdentifier(NSZone *_zone,
   }
   else {
     *_idx = pos;
-    return _makeStringForBuffer(&(_buffer[startPos]), len);
+    return [[StrClass alloc] initWithCharacters:&(_buffer[startPos])
+                            length:len];
   }
 }
 static NSString *_parseKeyPath(NSZone *_zone,
@@ -556,14 +551,15 @@ static NSString *_parseQString(NSZone *_zone,
       str[pos2] = 0;
       NSCAssert(pos2 == len, @"invalid unescape ..");
       
-      ostr = _makeStringForBuffer(str, pos2);
+      ostr = [[StrClass alloc] initWithCharacters:str length:pos2];
       if (str != NULL) free(str); str = NULL;
 
       return ostr;
     }
     else {
       NSCAssert(len > 0, @"invalid length ..");
-      return _makeStringForBuffer(&(_buffer[startPos]), len);
+      return [[StrClass alloc] initWithCharacters:&(_buffer[startPos]) 
+                              length:len];
     }
   }
 }
@@ -992,7 +988,7 @@ static id _parseProperty(NSZone *_zone, const unichar *_buffer, unsigned *_idx,
         if ((_buffer[*_idx] == 'Y') || (_buffer[*_idx] == 'N')) {
           // parse YES and NO
           if ((*_idx + 4) < _len) {
-            if (_ucIsEqual(&(_buffer[*_idx]), "YES", 3) == 0 &&
+            if (_ucIsEqual(&(_buffer[*_idx]), "YES", 3) &&
                _isBreakChar(_buffer[*_idx + 3])) {
               result = [yesNum retain];
               valueProperty = YES;
@@ -1000,7 +996,7 @@ static id _parseProperty(NSZone *_zone, const unichar *_buffer, unsigned *_idx,
             }
           }
           if (((*_idx + 3) < _len) && !valueProperty) {
-            if (_ucIsEqual(&(_buffer[*_idx]), "NO", 2) == 0 &&
+            if (_ucIsEqual(&(_buffer[*_idx]), "NO", 2) &&
                _isBreakChar(_buffer[*_idx + 2])) {
               result = [noNum retain];
               valueProperty = YES;
@@ -1011,7 +1007,7 @@ static id _parseProperty(NSZone *_zone, const unichar *_buffer, unsigned *_idx,
         else if ((_buffer[*_idx] == 't') || (_buffer[*_idx] == 'f')) {
           // parse true and false
           if ((*_idx + 5) < _len) {
-            if (_ucIsEqual(&(_buffer[*_idx]), "true", 4) == 0 &&
+            if (_ucIsEqual(&(_buffer[*_idx]), "true", 4) &&
                _isBreakChar(_buffer[*_idx + 4])) {
               result = [yesNum retain];
               valueProperty = YES;
@@ -1019,7 +1015,7 @@ static id _parseProperty(NSZone *_zone, const unichar *_buffer, unsigned *_idx,
             }
           }
           if (((*_idx + 6) < _len) && !valueProperty) {
-            if (_ucIsEqual(&(_buffer[*_idx]), "false", 5) == 0 &&
+            if (_ucIsEqual(&(_buffer[*_idx]), "false", 5) &&
                _isBreakChar(_buffer[*_idx + 5])) {
               result = [noNum retain];
               valueProperty = YES;
@@ -1051,7 +1047,7 @@ static id _parseProperty(NSZone *_zone, const unichar *_buffer, unsigned *_idx,
   }
 
   NSCAssert(result, @"missing property value ..");
-
+  
   if (_allowAssoc) {
     id old = result;
     
index c3803a3a79d40419e269f24b8811e9acf9a3779d..06bdea85663226675493a1983997b8e635c138ea 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=154
+SUBMINOR_VERSION:=156
 
 # v4.5.122 requires libNGExtensions v4.5.153
 # v4.5.91  requires libNGExtensions v4.5.134