mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 14:59:20 +02:00
Ignore attempts to set $OnceFile to the value it already has.
This commit is contained in:
11
src/var.c
11
src/var.c
@@ -167,11 +167,20 @@ static int latitude_func(int do_set, Value *val)
|
||||
static int oncefile_func(int do_set, Value *val)
|
||||
{
|
||||
if (do_set) {
|
||||
if (val->type != STR_TYPE) return E_BAD_TYPE;
|
||||
if (! (*val->v.str) && (!OnceFile || !*OnceFile)) {
|
||||
/* Trying to set already-empty string to empty string */
|
||||
return OK;
|
||||
}
|
||||
if (OnceFile && !strcmp(OnceFile, val->v.str)) {
|
||||
/* Trying to set to the exact same value */
|
||||
return OK;
|
||||
}
|
||||
|
||||
if (ProcessedOnce) {
|
||||
Wprint("Not setting $OnceFile: Already processed a reminder with a ONCE clause");
|
||||
return OK;
|
||||
}
|
||||
if (val->type != STR_TYPE) return E_BAD_TYPE;
|
||||
if (OnceFile) {
|
||||
free( (void *) OnceFile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user