Commit f59b403a f59b403aa3ef3bb13e992c1e69aa4976a2b7486d by Sergey Poznyakoff

For compatibility with older mails take a number alone to mean "print NUMBER"

1 parent b7a7196b
......@@ -114,6 +114,16 @@ util_do_command (const char *c, ...)
if (argcv_get (cmd, delim, NULL, &argc, &argv) == 0)
{
struct mail_command_entry entry;
char *p;
/* Special case: a number alone implies "print" */
if (argc == 1 && strtoul (argv[0], &p, 10) > 0 && *p == 0)
{
asprintf (&p, "print %s", argv[0]);
argcv_free (argc, argv);
argcv_get (p, delim, NULL, &argc, &argv);
free (p);
}
entry = util_find_entry (mail_command_table, argv[0]);
command = entry.func;
......