Some IEEE-1284 device IDs have spaces before and after the
manufacturer and model names. These need to be removed when generating
make-and-model strings for display, sorting, ... THis especially leads
to duplicate manufacturer names (extra mention of manufacturer in
model name) not being recognized and removed.
bufptr = buffer;
while (*makeptr != ':') makeptr ++;
makeptr ++;
+ while (isspace(*makeptr)) makeptr ++;
while (*makeptr != ';' && *makeptr != '\0' &&
bufptr < buffer + bufsize - 1)
{
makeptr ++;
bufptr ++;
}
+ while (isspace(*(bufptr - 1))) bufptr --;
if (bufptr < buffer + bufsize - 1)
{
*bufptr = ' ';
makeptr = bufptr;
while (*modelptr != ':') modelptr ++;
modelptr ++;
+ while (isspace(*modelptr)) modelptr ++;
while (*modelptr != ';' && *modelptr != '\0' &&
bufptr < buffer + bufsize - 1)
{
modelptr ++;
bufptr ++;
}
+ while (isspace(*(bufptr - 1))) bufptr --;
*bufptr = '\0';
if (!nomakemodel && makeptr != bufptr)
modelptr = makeptr;