]> err.no Git - sope/blobdiff - sope-appserver/WEPrototype/WEPrototypeScriptAction.m
fixed (all?) gcc 4.0 warnings
[sope] / sope-appserver / WEPrototype / WEPrototypeScriptAction.m
index 38ad677b11dc09a558171f1494c16000b8e6e5a1..126c1da53191d0b240d21c111a8cf82641bd3497 100644 (file)
@@ -35,7 +35,7 @@ static NSString *script =
 
 + (void)initialize {
   if (etag == nil) {
-    etag = [[NSString alloc] initWithFormat:@"\"sope/%i.%i-wep/%03i\"",
+    etag = [[NSString alloc] initWithFormat:@"\"sope/%i.%i-wep+%03i\"",
                             SOPE_MAJOR_VERSION, SOPE_MINOR_VERSION,
                             WEP_SUBMINOR_VERSION];
   }
@@ -51,11 +51,12 @@ static NSString *script =
   
   /* check preconditions */
   
-  s = [[[self context] request] headerForKey:@"if-none-match"];
-  if ([s rangeOfString:etag].length > 0) {
-    /* client already has the proper entity */
-    [r setStatus:304 /* Not Modified */];
-    return r;
+  if ((s = [[[self context] request] headerForKey:@"if-none-match"]) != nil) {
+    if ([s rangeOfString:etag].length > 0) {
+      /* client already has the proper entity */
+      [r setStatus:304 /* Not Modified */];
+      return r;
+    }
   }
   
   /* send script */