Spaces do not have to come after the ':' that ends a keyword.

Map bin name ManualEnv to DMBIN_ENVMANUAL.
This commit is contained in:
Huw D M Davies 2001-02-12 01:23:26 +00:00 committed by Alexandre Julliard
parent a62703e676
commit 8d50352b66
1 changed files with 19 additions and 12 deletions

View File

@ -166,6 +166,8 @@ static struct {
{"Envelope", DMBIN_ENVELOPE}, {"Envelope", DMBIN_ENVELOPE},
{"LargeCapacity", DMBIN_LARGECAPACITY}, {"LargeCapacity", DMBIN_LARGECAPACITY},
{"Lower", DMBIN_LOWER}, {"Lower", DMBIN_LOWER},
{"Manual", DMBIN_MANUAL},
{"ManualEnv", DMBIN_ENVMANUAL},
{"ManualFeed", DMBIN_MANUAL}, {"ManualFeed", DMBIN_MANUAL},
{"Middle", DMBIN_MIDDLE}, {"Middle", DMBIN_MIDDLE},
{"OnlyOne", DMBIN_ONLYONE}, {"OnlyOne", DMBIN_ONLYONE},
@ -356,7 +358,7 @@ static BOOL PSDRV_PPDGetSymbolValue(char *pos, PPDTuple *tuple)
*/ */
static BOOL PSDRV_PPDGetNextTuple(FILE *fp, PPDTuple *tuple) static BOOL PSDRV_PPDGetNextTuple(FILE *fp, PPDTuple *tuple)
{ {
char line[257], *opt = NULL, *cp, *trans; char line[257], *opt = NULL, *cp, *trans, *endkey;
BOOL gotoption = TRUE; BOOL gotoption = TRUE;
memset(tuple, 0, sizeof(*tuple)); memset(tuple, 0, sizeof(*tuple));
@ -373,25 +375,29 @@ static BOOL PSDRV_PPDGetNextTuple(FILE *fp, PPDTuple *tuple)
return FALSE; return FALSE;
} }
for(cp = line; !isspace(*cp); cp++) for(cp = line; !isspace(*cp) && *cp != ':'; cp++)
; ;
if(*(cp-1) == ':') { endkey = cp;
cp--; if(*cp == ':') { /* <key>: */
gotoption = FALSE; gotoption = FALSE;
} else { } else {
opt = cp; while(isspace(*cp))
cp++;
if(*cp == ':') { /* <key> : */
gotoption = FALSE;
} else { /* <key> <option> */
opt = cp;
}
} }
tuple->key = HeapAlloc( PSDRV_Heap, 0, cp - line + 1 ); tuple->key = HeapAlloc( PSDRV_Heap, 0, endkey - line + 1 );
if(!tuple->key) return FALSE; if(!tuple->key) return FALSE;
memcpy(tuple->key, line, cp - line); memcpy(tuple->key, line, endkey - line);
tuple->key[cp - line] = '\0'; tuple->key[endkey - line] = '\0';
if(gotoption) { if(gotoption) { /* opt points to 1st non-space character of the option */
while(isspace(*opt))
opt++;
cp = strpbrk(opt, ":/"); cp = strpbrk(opt, ":/");
if(!cp) { if(!cp) {
ERR("Error in line '%s'?\n", line); ERR("Error in line '%s'?\n", line);
@ -417,7 +423,8 @@ static BOOL PSDRV_PPDGetNextTuple(FILE *fp, PPDTuple *tuple)
HeapFree( PSDRV_Heap, 0, buf ); HeapFree( PSDRV_Heap, 0, buf );
} }
} }
while(!isspace(*cp))
/* cp should point to a ':', so we increment past it */
cp++; cp++;
while(isspace(*cp)) while(isspace(*cp))