]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Log a different error for an out-of-date PPD cache.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 13 Apr 2011 15:23:41 +0000 (15:23 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 13 Apr 2011 15:23:41 +0000 (15:23 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@9679 7a7537e8-13f0-0310-91df-b6672ffda945

cups/ppd-cache.c

index f312e6936e889b034197e597f4145b2ee10967fd..77a56622c6d1a4fa60edace8b90a0b61a773e191 100644 (file)
@@ -139,8 +139,7 @@ _ppdCacheCreateWithFile(
     return (NULL);
   }
 
-  if (strncmp(line, "#CUPS-PPD-CACHE-", 16) ||
-      atoi(line + 16) != _PPD_CACHE_VERSION)
+  if (strncmp(line, "#CUPS-PPD-CACHE-", 16))
   {
     _cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
     DEBUG_printf(("_ppdCacheCreateWithFile: Wrong first line \"%s\".", line));
@@ -148,6 +147,15 @@ _ppdCacheCreateWithFile(
     return (NULL);
   }
 
+  if (atoi(line + 16) != _PPD_CACHE_VERSION)
+  {
+    _cupsSetError(IPP_INTERNAL_ERROR, _("Out of date PPD cache file."), 1);
+    DEBUG_printf(("_ppdCacheCreateWithFile: Cache file has version %s, "
+                  "expected %d.", line + 16, _PPD_CACHE_VERSION));
+    cupsFileClose(fp);
+    return (NULL);
+  }
+
  /*
   * Allocate the mapping data structure...
   */