mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Treat a null -k option as no -k option
This commit is contained in:
@@ -916,6 +916,11 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int dse, int is_queue
|
||||
msg_command = QueuedMsgCommand;
|
||||
}
|
||||
|
||||
/* A null command is no command */
|
||||
if (msg_command && !*msg_command) {
|
||||
msg_command = NULL;
|
||||
}
|
||||
|
||||
int red = -1, green = -1, blue = -1;
|
||||
int is_color = 0;
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse,
|
||||
mode != CAL_MODE &&
|
||||
mode != ADVANCE_MODE &&
|
||||
t->typ != RUN_TYPE &&
|
||||
!MsgCommand) {
|
||||
!(MsgCommand && *MsgCommand)) {
|
||||
if (DBufPutc(dbuf, '\n') != OK) return E_NO_MEM;
|
||||
}
|
||||
break;
|
||||
@@ -794,7 +794,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse,
|
||||
break;
|
||||
|
||||
case '_':
|
||||
if (PsCal == PSCAL_LEVEL2 || PsCal == PSCAL_LEVEL3 || (mode != CAL_MODE && mode != ADVANCE_MODE && !MsgCommand)) {
|
||||
if (PsCal == PSCAL_LEVEL2 || PsCal == PSCAL_LEVEL3 || (mode != CAL_MODE && mode != ADVANCE_MODE && !(MsgCommand && *MsgCommand))) {
|
||||
snprintf(s, sizeof(s), "%s", NL);
|
||||
} else {
|
||||
snprintf(s, sizeof(s), " ");
|
||||
|
||||
@@ -602,13 +602,9 @@ void InitRemind(int argc, char const *argv[])
|
||||
case 'K':
|
||||
if (*arg == ':') {
|
||||
arg++;
|
||||
if (*arg) {
|
||||
QueuedMsgCommand = arg;
|
||||
}
|
||||
QueuedMsgCommand = arg;
|
||||
} else {
|
||||
if (*arg) {
|
||||
MsgCommand = arg;
|
||||
}
|
||||
MsgCommand = arg;
|
||||
}
|
||||
while (*arg) arg++; /* Chew up remaining chars in this arg */
|
||||
break;
|
||||
|
||||
@@ -135,7 +135,7 @@ void IssueSortedReminders(void)
|
||||
next = cur->next;
|
||||
switch(cur->typ) {
|
||||
case MSG_TYPE:
|
||||
if (MsgCommand) {
|
||||
if (MsgCommand && *MsgCommand) {
|
||||
DoMsgCommand(MsgCommand, cur->text);
|
||||
} else {
|
||||
if (cur->trigdate != olddate) {
|
||||
|
||||
Reference in New Issue
Block a user