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,

> From: "Ray Johnston" <[email protected]>
> To: "Igor V. Melichev" <[email protected]>
> Cc: "Alex Cherepanov" <[email protected]>; "Miles Jones"
<[email protected]>; "GS Code Review List"
<[email protected]>
> Sent: Thursday, December 11, 2003 2:38 AM
> Subject: Re: [gs-code-review] Fix for 687151, gswin32 starts with 7s
delay..., improved log message


> I think your code for finding the 'head_size' searching back from
> the end is not correct. You check pattern[i] without updating 'i'.
>
> I think you meant:
>
>        for (i = j - 1; i > 0; i--)
>           if(pattern[i] == '/' || pattern[i] == '\\' || pattern[i] == ':')
>               break;
>       hsize = i + 1;
>
> But with no directory serparator, this will terminate with i==0,
> setting hsize to 1 instead of 0. You probably also meant to have
> the loop run as long as 'i >= 0'.

Right you are. I'm sorry for inaccuracy.

> The code I had initialized hsize=0, so with no directory separator,
> hsize would be left at 0.

OK. I'm sorry for missing it while the first reading.

> Also an error might be reasonable if there is
> a ? or * in the directory portion (head) since that is not implemented.

Agree.

> I am not sure if 'invalidaccess' is the best error to throw for either
> case. Possibly 'ioerror' for the \? an \* case and 'rangecheck' or
> 'limitcheck' for the second case (although 'limitcheck' is not listed
> in the PLRM as a possible error, it tends to be used for implementation
> limitations).

I don't like 'ioerror' here, because it assumes a bad disk content.
'rangecheck' should be fine.

Igor.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.