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

Funny bug when autoloading with syntax error



Autoload the following function:

if (( 1 )): then   # note colon instead of semicolon
  true
fi

This loads silently, unlike trying it at the command line which gives a
parse error near `fi', which is not unexpected.  `which fn' gives

fn () {
        if (( 1 ))
        then
                : then
        fi
        true
}

This is, not to put too fine a point on it, wrong.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>



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