On 4/25/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> On 4/25/06, Nick Pilon <[EMAIL PROTECTED]> wrote:
> > If you try to add a directory that doesn't exist to your PATH using a
> > copy of fish built from the current darcs source, you get a whole lot
> > of confusing errors:
> >
> > set: Could not add component /foo to PATH.
> > set: Value too large to be stored in data type
> >
> > Not only does this not explain what the problem is, but you get it
> > repeated a whole bunch of times. (Every time fish launches a subshell,
> > I think) The Right Thing To Do would seem to be to have a sensible
> > error message (set: Directory does not exist) displayed exactly once.
>
>
> On my system:
>
> fish> set PATH $PATH /fdsa
> set: Could not add component /fdsa to PATH.
> set: No such file or directory
>
> E.g it works exactly as you describe. Any insights into why this is
> broken on OS X is welcome.

Found the problem. Somewhere between builtin_set.c:507 and
builtin.c:154, errno is getting changed from "2" (no such file or
directory) to "84" (value too large). There are a /lot/ of function
calls between these two lines, and I believe that relying on errno to
remain unchanged across all of them is very bad practice in general.
What the code should be doing is saving the errno after it detects the
error, then using its saved version (perhaps as a parameter to
builtin_wperror ?) instead of the global errno.

Want me to patch it to do this? There only appear to be about five
calls to builtin_wperror, so it doesn't look too time-consuming.

--
-Nick Pilon
Rȧ�:&q�[���y�hv����^y�h��i��py����z�r���!���n}�h�ꮉ�%����ފ{^���y�^r薈2����쨺��m欉�ã
     塧HŞm*az����bq�b�t�����]5m�v����!xg��x��m���zV���ږF�����\�

Reply via email to