Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: autoload with explicit path



On Thu, Jan 12, 2017 at 7:56 AM, Peter Stephenson <p.stephenson@xxxxxxxxxxx>
wrote:

> I can't reproduce this using the normal tests, but I have found a
> possible cause and added a test that does fail in the same way.  This
> patch fixes that failure.
>
> The problem is the overloading of filename in struct shfunc.  If the
> function was alrady loaded, which is the case if it contains an
> explicit autoload -X (rather than one generated internally by looking
> at the flags for an undefined function), then the filename indicates the
> location of the source for the function.  If this came from a file with
> an absolute path, and there was no explicit directory path in the
> autoload -X statement, the file path was erroneously taken as a
> directory for loading.
>
> This adds an explicit flag to indicate filename is being used for that
> purpose, unsetting it when the filename is set to the file's path.
>
> Also be a bit more careful checking if a function wasn't let loaded when
> using the new functions options.  If it's already loaded they're
> irrelevant.
>

That has fixed the failures for me: I'm now seeing 48 successful tests.

Thanks,
  Vin


Messages sorted by: Reverse Date, Date, Thread, Author