Re: Fix for 687151, gswin32 starts with 7s delay..., improved log message
"Igor V. Melichev" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
Ray,
Your \lib/* case is useful.
But I've got 2 remarks :
1. IMO \* and/or \? on Windows and/or OS/2 should return invalidaccess.
2. You wrote :
> ! for (i = 0, j=0; i < patlen; i++) {
> ! if (pat[i] == '\\') {
> i++;
> ! if (i == patlen)
> ! break; /* '\' at end ignored */
> }
> + pattern[j++]=pat[i];
> + }
> + /* Scan for last path separator to determine 'head_size' (directory
part)
> */
> + for (i = 0; i < j; i++) {
> + if(pattern[i] == '/' || pattern[i] == '\\' || pattern[i] == ':')
> + hsize = i+1;
> }
I would code it like this :
for (i = 0, j=0; i < patlen; i++)
if (pat[i] != '\\')
pattern[j++]=pat[i];
for (i = j - 1; j > 0; j--)
if(pattern[i] == '/' || pattern[i] == '\\' || pattern[i] == ':')
break;
hsize = i + 1;
Note how the 2nd cycle behaves with no dir separator.
I suggest to return all this to Alex for refinishing.
Igor.