For compatibility with older mails take a number alone to mean "print NUMBER"
Showing
1 changed file
with
10 additions
and
0 deletions
... | @@ -114,6 +114,16 @@ util_do_command (const char *c, ...) | ... | @@ -114,6 +114,16 @@ util_do_command (const char *c, ...) |
114 | if (argcv_get (cmd, delim, NULL, &argc, &argv) == 0) | 114 | if (argcv_get (cmd, delim, NULL, &argc, &argv) == 0) |
115 | { | 115 | { |
116 | struct mail_command_entry entry; | 116 | struct mail_command_entry entry; |
117 | char *p; | ||
118 | |||
119 | /* Special case: a number alone implies "print" */ | ||
120 | if (argc == 1 && strtoul (argv[0], &p, 10) > 0 && *p == 0) | ||
121 | { | ||
122 | asprintf (&p, "print %s", argv[0]); | ||
123 | argcv_free (argc, argv); | ||
124 | argcv_get (p, delim, NULL, &argc, &argv); | ||
125 | free (p); | ||
126 | } | ||
117 | 127 | ||
118 | entry = util_find_entry (mail_command_table, argv[0]); | 128 | entry = util_find_entry (mail_command_table, argv[0]); |
119 | command = entry.func; | 129 | command = entry.func; | ... | ... |
-
Please register or sign in to post a comment