bug-mcron
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fix parsing of "--schedule" option without value


From: Dale Mellor
Subject: Re: [PATCH] fix parsing of "--schedule" option without value
Date: Wed, 26 Jan 2022 18:43:55 +0000
User-agent: Evolution 3.38.3-1

On Wed, 2022-01-26 at 13:31 +0100, François J wrote:
> Help message states that default value for "-s" option was "8" but the
> predicate used in getopt-long definition triggered a crash if value was
> not passed.
> 
> * src/mcron/scripts/mcron.scm (main): change predicate for --schedule option
> ---
>  src/mcron/scripts/mcron.scm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mcron/scripts/mcron.scm b/src/mcron/scripts/mcron.scm
> index a6b1fa2..d4336f6 100644
> --- a/src/mcron/scripts/mcron.scm
> +++ b/src/mcron/scripts/mcron.scm
> @@ -118,7 +118,8 @@ directory. Double-check the folder and file permissions 
> and syntax."))))
>                              (predicate ,(λ (in) (or (string=? in "guile")
>                                                      (string=? in "vixie")))))
>                    (schedule (single-char #\s) (value optional)
> -                            (predicate ,string->number))
> +                            (predicate ,(λ (s) (or (eqv? #t s)
> +                                                   (string->number s)))))
>                    (help     (single-char #\?))
>                    (version  (single-char #\V))))))
>  

   This is a known problem, see earlier posts to this list.  Unfortunately your 
solution fails with a line like
'mcron -s jobs.guile'.  The only way this can be solved is with a fix to 
Guile's getopt-long module.  A patch has
been submitted upstream some time ago, we can only wait until somebody decides 
to put it in.

Best,
Dale





reply via email to

[Prev in Thread] Current Thread [Next in Thread]