[prev in list] [next in list] [prev in thread] [next in thread]
List: dovecot
Subject: Re: sievec: Misleading error message
From: Markus_Schönhaber <dovecot () list-post ! mks-mail ! de>
Date: 2023-08-25 11:55:13
Message-ID: c92eb26a-690f-4fa8-8326-b7564d3e9ad5 () list-post ! mks-mail ! de
[Download RAW message or body]
25.08.23, 13:06 +0200, Robert Nowotny via dovecot:
> I would say "elsif" itself is a typo - in most languages it is "elseif".
> in that case both versions should be valid keywords - the current (but
> unusual) "elsif"
> and the more common "elseif"
You are obviously entitled to your opinion, but what matters wrt to the
language syntax is the language specification. And the relevant RFC
specifies[1] the control if as if ... elsif ... else, regardless if one
likes that or not.
[1] https://www.rfc-editor.org/rfc/rfc5228.html#section-3.1
So, I concur with Horst that there's a typo in the error message that
should be corrected.
(trivial patch attached)
> Am 25.08.2023 um 12:38 schrieb Horst Prote:
>> Hi,
>>
>> in a sieve script I just made a syntax error and got this error
>> message on
>> calling sievec:
>>
>> error: the else command must follow an if or elseif command.
>>
>> My first thougth was "Are you kidding me!" as I used "elseif". But then I
>> realized that the correct syntax is "elsif". So I think that error
>> message
>> should be corrected to
>>
>> error: the else command must follow an if or elsif command.
--
Regards
mks
["elsif_errormsg.patch" (text/x-patch)]
diff --git a/src/lib-sieve/cmd-if.c b/src/lib-sieve/cmd-if.c
index 2ae186e3..bd6b5a05 100644
--- a/src/lib-sieve/cmd-if.c
+++ b/src/lib-sieve/cmd-if.c
@@ -148,7 +148,7 @@ static bool cmd_elsif_validate
( !sieve_command_is(prev, cmd_if) && !sieve_command_is(prev, cmd_elsif) ) )
{
sieve_command_validate_error(valdtr, cmd,
- "the %s command must follow an if or elseif command",
+ "the %s command must follow an if or elsif command",
sieve_command_identifier(cmd));
return FALSE;
}
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-leave@dovecot.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic