crond: code shrink
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 8 Jul 2017 22:08:13 +0000 (00:08 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 8 Jul 2017 22:08:13 +0000 (00:08 +0200)
function                                             old     new   delta
load_crontab                                         936     925     -11

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/crond.c

index a472c9b230ffcf68908221e0f18697f8c9db2de7..c0c8bef11579a39c55e62fcd651dfe0a9067426b 100644 (file)
@@ -512,13 +512,12 @@ static void load_crontab(const char *fileName)
                                        if (strcmp(e->name, tokens[0] + 1) == 0) {
                                                /*
                                                 * tokens[1] is only the first word of command,
+                                                * can'r use it.
                                                 * find the entire command in unmodified string:
                                                 */
-                                               tokens[5] = strstr(
-                                                       skip_non_whitespace(skip_whitespace(parser->data)),
-                                                       /* ^^^^ avoids mishandling e.g. "@daily aily PARAM" */
-                                                       tokens[1]
-                                               );
+                                               tokens[5] = skip_whitespace(
+                                                       skip_non_whitespace(
+                                                       skip_whitespace(parser->data)));
                                                if (e->tokens[0]) {
                                                        char *et = (char*)e->tokens;
                                                        /* minute is "0" for all specials */