From: mike Date: Wed, 13 Apr 2011 15:23:41 +0000 (+0000) Subject: Log a different error for an out-of-date PPD cache. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=607f70a3948255655cfa24d84440c54ecc83165c;p=thirdparty%2Fcups.git Log a different error for an out-of-date PPD cache. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@9679 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index f312e6936e..77a56622c6 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -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... */