~vcs-imports/busybox/trunk

« back to all changes in this revision

Viewing changes to mailutils/reformime.c

  • Committer: Denys Vlasenko
  • Author(s): Christian Franke
  • Date: 2023-11-13 10:32:35 UTC
  • Revision ID: git-v1:a63b60bdd6fa26b867c80d44074118babbae7ffd
Cygwin: regenerate defconfig

Signed-off-by: Christian Franke <christian.franke@t-online.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * Licensed under GPLv2, see file LICENSE in this source tree.
8
8
 */
9
9
//config:config REFORMIME
10
 
//config:       bool "reformime (7.5 kb)"
 
10
//config:       bool "reformime (7.6 kb)"
11
11
//config:       default y
12
12
//config:       help
13
13
//config:       Parse MIME-formatted messages.
115
115
                /* Split to tokens */
116
116
                {
117
117
                        char *s, *p;
 
118
                        char *tokstate;
118
119
                        unsigned ntokens;
119
120
                        const char *delims = ";=\" \t\n";
120
121
 
127
128
                        }
128
129
                        dbg_error_msg("L:'%s'", p);
129
130
                        ntokens = 0;
130
 
                        s = strtok(s, delims);
 
131
                        s = strtok_r(s, delims, &tokstate);
131
132
                        while (s) {
132
133
                                tokens[ntokens] = s;
133
134
                                if (ntokens < ARRAY_SIZE(tokens) - 1)
134
135
                                        ntokens++;
135
136
                                dbg_error_msg("L[%d]='%s'", ntokens, s);
136
 
                                s = strtok(NULL, delims);
 
137
                                s = strtok_r(NULL, delims, &tokstate);
137
138
                        }
138
139
                        tokens[ntokens] = NULL;
139
140
                        dbg_error_msg("EMPTYLINE, ntokens:%d", ntokens);
165
166
                        else
166
167
                                filename = bb_get_last_path_component_strip(xstrdup(filename));
167
168
 
168
 
                        if (opts & OPT_X) {
 
169
                        if (option_mask32 & OPT_X) {
169
170
                                int fd[2];
170
171
 
171
172
                                /* start external helper */
218
219
                        fclose(fp);
219
220
 
220
221
                        /* Wait for child */
221
 
                        if (opts & OPT_X) {
 
222
                        if (option_mask32 & OPT_X) {
222
223
                                int rc;
223
224
                                signal(SIGPIPE, SIG_DFL);
224
225
                                rc = (wait4pid(pid) & 0xff);
274
275
int reformime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
275
276
int reformime_main(int argc UNUSED_PARAM, char **argv)
276
277
{
 
278
        unsigned opts;
277
279
        const char *opt_prefix = "";
278
280
 
279
281
        INIT_G();