Skip to content

Commit 66721cc

Browse files
committed
Replaces shadowed "-t <interval>" with "-timer <interval>"
At some point option "-t" was introduced as an abbreviation for "-title" but "-t" was already in use, though undocumented, for overriding the timer interval. This commit changes the command line timer option to "-timer" and adds "timer" to the options that are processed from the X11 resources.
1 parent b13a35e commit 66721cc

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,20 +407,20 @@ int main(int argc, char *argv[])
407407
}
408408
}
409409

410-
/* -t and -m are undocumented and somewhat dangerous... */
410+
/* -timer and -m are undocumented and somewhat dangerous... */
411411

412-
else if (!strcmp(argv[i], "-t")) { /**** timer interval ****/
412+
else if (!strcmp(argv[i], "-timer")) { /**** timer interval ****/
413413
if (argc > ++i) {
414414
errno = 0;
415415
tmpint = strtol(argv[i], (char **)NULL, 10);
416416
if (errno == 0 && tmpint > 0) {
417417
TIMER_INTERVAL = tmpint;
418418
} else {
419-
(void)fprintf(stderr, "Bad value for -t (integer > 0)\n");
419+
(void)fprintf(stderr, "Bad value for -timer (integer > 0)\n");
420420
exit(1);
421421
}
422422
} else {
423-
(void)fprintf(stderr, "Missing argument after -t\n");
423+
(void)fprintf(stderr, "Missing argument after -timer\n");
424424
exit(1);
425425
}
426426
}

src/xrdopt.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ extern int LispDisplayRequestedX, LispDisplayRequestedY;
3636
extern unsigned LispDisplayRequestedWidth, LispDisplayRequestedHeight;
3737

3838
extern int xsync;
39+
extern int TIMER_INTERVAL;
3940

4041
static XrmOptionDescRec opTable[] = {
4142
{"-help", "*help", XrmoptionIsArg, (XPointer)NULL},
@@ -297,6 +298,14 @@ void read_Xoption(int *argc, char *argv[])
297298
noscroll = 1;
298299
}
299300

301+
if (XrmGetResource(rDB, "ldex.timer", "Ldex.timer", str_type, &value) == True) {
302+
(void)strncpy(tmp, value.addr, value.size);
303+
errno = 0;
304+
i = (int)strtol(tmp, (char **)NULL, 10);
305+
if (errno == 0 && i > 0)
306+
TIMER_INTERVAL = i;
307+
}
308+
300309
/* if (XrmGetResource(rDB,
301310
"ldex.maxpages",
302311
"Ldex.maxpages",

0 commit comments

Comments
 (0)