Module: wine Branch: master Commit: eb272cbd31380a115f9665e7bd2a2aaab5a3b000 URL: http://source.winehq.org/git/wine.git/?a=commit;h=eb272cbd31380a115f9665e7bd...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Thu Dec 20 16:24:35 2012 +0800
wineps.drv: Slightly simplify a PPD parser code snippet.
---
dlls/wineps.drv/ppd.c | 16 +++++----------- 1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/dlls/wineps.drv/ppd.c b/dlls/wineps.drv/ppd.c index 9d529b4..db1e580 100644 --- a/dlls/wineps.drv/ppd.c +++ b/dlls/wineps.drv/ppd.c @@ -385,17 +385,11 @@ static BOOL PSDRV_PPDGetNextTuple(FILE *fp, PPDTuple *tuple) ;
endkey = cp; - if(*cp == ':') { /* <key>: */ + while (isspace(*cp)) cp++; + if (*cp == ':') /* <key>: */ gotoption = FALSE; - } else { - while(isspace(*cp)) - cp++; - if(*cp == ':') { /* <key> : */ - gotoption = FALSE; - } else { /* <key> <option> */ - opt = cp; - } - } + else /* <key> <option> */ + opt = cp;
tuple->key = HeapAlloc( PSDRV_Heap, 0, endkey - line + 1 ); if(!tuple->key) return FALSE; @@ -434,7 +428,7 @@ static BOOL PSDRV_PPDGetNextTuple(FILE *fp, PPDTuple *tuple) }
/* cp should point to a ':', so we increment past it */ - cp++; + cp++;
while(isspace(*cp)) cp++;