be...@bmevers.de skribis:

> From: Benno Evers <be...@bmevers.de>
>
> * guix/scripts/edit.scm (guix-edit): Check if %editor exists.
> ---
> These are my first lines of guile, so probably there is a much
> better way to do this :D
>
> The previous error message ("execlp: No such file or directory")
> had me confused for a while, though.

Indeed.

You’re doing OK Scheme-wise, no worries!  ;-)

> +    (unless (search-path (parse-path (getenv "PATH")) (%editor))
> +      (leave (_ "Couldn't find editor '~a'. Please check $EDITOR and $PATH.")
> +             (%editor)))

In commit 650f161, I did things slightly differently by catching the
actual ‘execl’ exception and reporting it.  This is more accurate than
using ‘search-path’ because there could be other errors (invalid
permissions, etc.) and possibly TOCTTOU races.

Thank you!

Ludo’.

Reply via email to