aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/sed.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 5ae7993c7..6ee4693cb 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -63,7 +63,7 @@ extern char *optarg; /* ditto */
63static int be_quiet = 0; 63static int be_quiet = 0;
64 64
65 65
66struct sed_cmd { 66typedef struct sed_cmd_s {
67 /* Order by alignment requirements */ 67 /* Order by alignment requirements */
68 68
69 /* address storage */ 69 /* address storage */
@@ -101,10 +101,10 @@ struct sed_cmd {
101 101
102 /* inversion flag */ 102 /* inversion flag */
103 int invert; /* the '!' after the address */ 103 int invert; /* the '!' after the address */
104}; 104} sed_cmd_t;
105 105
106/* globals */ 106/* globals */
107static struct sed_cmd *sed_cmds = NULL; /* growable arrary holding a sequence of sed cmds */ 107static sed_cmd_t *sed_cmds = NULL; /* growable arrary holding a sequence of sed cmds */
108static int ncmds = 0; /* number of sed commands */ 108static int ncmds = 0; /* number of sed commands */
109 109
110/*static char *cur_file = NULL;*/ /* file currently being processed XXX: do I need this? */ 110/*static char *cur_file = NULL;*/ /* file currently being processed XXX: do I need this? */
@@ -208,7 +208,7 @@ static int get_address(char *delimiter, char *my_str, int *linenum, regex_t **re
208 return idx; 208 return idx;
209} 209}
210 210
211static int parse_subst_cmd(struct sed_cmd * const sed_cmd, const char *substr) 211static int parse_subst_cmd(sed_cmd_t * const sed_cmd, const char *substr)
212{ 212{
213 int oldidx, cflags = REG_NEWLINE; 213 int oldidx, cflags = REG_NEWLINE;
214 char *match; 214 char *match;
@@ -292,7 +292,7 @@ static void move_back(char *str, int offset)
292 memmove(str, str + offset, strlen(str + offset) + 1); 292 memmove(str, str + offset, strlen(str + offset) + 1);
293} 293}
294 294
295static int parse_edit_cmd(struct sed_cmd *sed_cmd, const char *editstr) 295static int parse_edit_cmd(sed_cmd_t *sed_cmd, const char *editstr)
296{ 296{
297 int i, j; 297 int i, j;
298 298
@@ -343,7 +343,7 @@ static int parse_edit_cmd(struct sed_cmd *sed_cmd, const char *editstr)
343} 343}
344 344
345 345
346static int parse_file_cmd(struct sed_cmd *sed_cmd, const char *filecmdstr) 346static int parse_file_cmd(sed_cmd_t *sed_cmd, const char *filecmdstr)
347{ 347{
348 int idx = 0; 348 int idx = 0;
349 int filenamelen = 0; 349 int filenamelen = 0;
@@ -380,7 +380,7 @@ static int parse_file_cmd(struct sed_cmd *sed_cmd, const char *filecmdstr)
380} 380}
381 381
382 382
383static char *parse_cmd_str(struct sed_cmd * const sed_cmd, char *cmdstr) 383static char *parse_cmd_str(sed_cmd_t * const sed_cmd, char *cmdstr)
384{ 384{
385 int idx = 0; 385 int idx = 0;
386 386
@@ -483,9 +483,9 @@ static void add_cmd_str(const char * const cmdstr)
483 continue; 483 continue;
484 } 484 }
485 /* grow the array */ 485 /* grow the array */
486 sed_cmds = xrealloc(sed_cmds, sizeof(struct sed_cmd) * (++ncmds)); 486 sed_cmds = xrealloc(sed_cmds, sizeof(sed_cmd_t) * (++ncmds));
487 /* zero new element */ 487 /* zero new element */
488 memset(&sed_cmds[ncmds-1], 0, sizeof(struct sed_cmd)); 488 memset(&sed_cmds[ncmds-1], 0, sizeof(sed_cmd_t));
489 /* load command string into new array element, get remainder */ 489 /* load command string into new array element, get remainder */
490 mystr = parse_cmd_str(&sed_cmds[ncmds-1], mystr); 490 mystr = parse_cmd_str(&sed_cmds[ncmds-1], mystr);
491 491
@@ -592,7 +592,7 @@ static void print_subst_w_backrefs(const char *line, const char *replace,
592 } 592 }
593} 593}
594 594
595static int do_subst_command(const struct sed_cmd *sed_cmd, char **line) 595static int do_subst_command(const sed_cmd_t *sed_cmd, char **line)
596{ 596{
597 char *hackline = *line; 597 char *hackline = *line;
598 struct pipeline thepipe = { NULL, 0 , 0}; 598 struct pipeline thepipe = { NULL, 0 , 0};
@@ -676,7 +676,7 @@ static void process_file(FILE *file)
676 676
677 /* for every line, go through all the commands */ 677 /* for every line, go through all the commands */
678 for (i = 0; i < ncmds; i++) { 678 for (i = 0; i < ncmds; i++) {
679 struct sed_cmd *sed_cmd = &sed_cmds[i]; 679 sed_cmd_t *sed_cmd = &sed_cmds[i];
680 int deleted = 0; 680 int deleted = 0;
681 681
682 /* 682 /*