|
10 | 10 | * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
|
11 | 11 | *
|
12 | 12 | * Written by Russ Allbery <[email protected]>
|
13 |
| - * Copyright 2017-2018, 2020 Russ Allbery <[email protected]> |
| 13 | + * Copyright 2017-2018, 2020, 2024 Russ Allbery <[email protected]> |
14 | 14 | * Copyright 2011-2012, 2014
|
15 | 15 | * The Board of Trustees of the Leland Stanford Junior University
|
16 | 16 | *
|
@@ -157,7 +157,8 @@ static char *
|
157 | 157 | readline(FILE *file)
|
158 | 158 | {
|
159 | 159 | char buffer[BUFSIZ];
|
160 |
| - char *line, *first; |
| 160 | + char *line; |
| 161 | + const char *first; |
161 | 162 |
|
162 | 163 | do {
|
163 | 164 | line = fgets(buffer, sizeof(buffer), file);
|
@@ -426,7 +427,7 @@ static void
|
426 | 427 | split_options(char *string, struct options *options,
|
427 | 428 | const struct script_config *config)
|
428 | 429 | {
|
429 |
| - char *opt; |
| 430 | + const char *opt; |
430 | 431 | size_t size, count;
|
431 | 432 |
|
432 | 433 | for (opt = strtok(string, " "); opt != NULL; opt = strtok(NULL, " ")) {
|
@@ -462,7 +463,8 @@ static void
|
462 | 463 | parse_options(FILE *script, struct work *work,
|
463 | 464 | const struct script_config *config)
|
464 | 465 | {
|
465 |
| - char *line, *group, *token; |
| 466 | + char *line, *token; |
| 467 | + const char *group; |
466 | 468 | size_t length = 0;
|
467 | 469 | enum group_type type;
|
468 | 470 |
|
@@ -497,9 +499,10 @@ parse_options(FILE *script, struct work *work,
|
497 | 499 | * action struct to fill in with the call and the option flags.
|
498 | 500 | */
|
499 | 501 | static void
|
500 |
| -parse_call(char *token, struct action *action) |
| 502 | +parse_call(const char *token, struct action *action) |
501 | 503 | {
|
502 |
| - char *flags, *flag; |
| 504 | + char *flags; |
| 505 | + const char *flag; |
503 | 506 |
|
504 | 507 | action->flags = 0;
|
505 | 508 | flags = strchr(token, '(');
|
@@ -528,7 +531,8 @@ static struct action *
|
528 | 531 | parse_run(FILE *script)
|
529 | 532 | {
|
530 | 533 | struct action *head = NULL, *current = NULL, *next;
|
531 |
| - char *line, *token, *call; |
| 534 | + char *line, *token; |
| 535 | + const char *call; |
532 | 536 | size_t length = 0;
|
533 | 537 |
|
534 | 538 | for (line = readline(script); line != NULL; line = readline(script)) {
|
@@ -576,7 +580,8 @@ parse_run(FILE *script)
|
576 | 580 | static int
|
577 | 581 | parse_end(FILE *script)
|
578 | 582 | {
|
579 |
| - char *line, *token, *flag; |
| 583 | + char *line, *token; |
| 584 | + const char *flag; |
580 | 585 | size_t length = 0;
|
581 | 586 | int flags = PAM_SUCCESS;
|
582 | 587 |
|
@@ -622,7 +627,8 @@ parse_end(FILE *script)
|
622 | 627 | static struct output *
|
623 | 628 | parse_output(FILE *script, const struct script_config *config)
|
624 | 629 | {
|
625 |
| - char *line, *token, *message; |
| 630 | + char *line, *message; |
| 631 | + const char *token; |
626 | 632 | struct output *output;
|
627 | 633 | int priority;
|
628 | 634 |
|
@@ -662,7 +668,8 @@ parse_prompts(FILE *script, const struct script_config *config)
|
662 | 668 | {
|
663 | 669 | struct prompts *prompts = NULL;
|
664 | 670 | struct prompt *prompt;
|
665 |
| - char *line, *token, *style, *end; |
| 671 | + char *line, *token, *end; |
| 672 | + const char *style; |
666 | 673 | size_t size, count, i;
|
667 | 674 | size_t length = 0;
|
668 | 675 |
|
|
0 commit comments