diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-05-13 19:44:21 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-05-13 19:44:21 +0000 |
commit | de9ab66a62aa84fe641f2612ac0c8396866d3fd1 (patch) | |
tree | bc1fadb106daa03f428837b581f21f58cc02a6ec /textproc | |
parent | Prevent collision with getline(3) (diff) |
Prevent collision with getline(3)
Notes
Notes:
svn path=/head/; revision=415145
Diffstat (limited to 'textproc')
-rw-r--r-- | textproc/mgdiff/files/patch-rundiff.c | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/textproc/mgdiff/files/patch-rundiff.c b/textproc/mgdiff/files/patch-rundiff.c new file mode 100644 index 000000000000..f2c64625d153 --- /dev/null +++ b/textproc/mgdiff/files/patch-rundiff.c @@ -0,0 +1,92 @@ +--- rundiff.c.orig 1994-05-19 02:01:22 UTC ++++ rundiff.c +@@ -63,7 +63,7 @@ typedef enum { ADD = 1, CHANGE, DELETE, + static char *duplicate (char *s, int *flag); + static DiffType parse_diff_line (char *buf, int *f1n1, int *f1n2, int *f2n1, int *f2n2); + static int eatline (FILE *f); +-static void getline (FILE *f, char **cooked, char **raw); ++static void get_line (FILE *f, char **cooked, char **raw); + static void reset_blist (void); + static Block *get_blist (void); + static void add_blist (Block *b); +@@ -271,7 +271,7 @@ DiffInfo *build_diff_info (char *prog, c + b->arr[LEFT].wtext = (char **) calloc (b->arr[LEFT].fsize, sizeof (char *)); + b->arr[LEFT].tlen = (short *) calloc (b->arr[LEFT].fsize, sizeof (short)); + for (i = 0; i < b->arr[LEFT].fsize; i++) { +- getline (file1, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); ++ get_line (file1, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); + b->arr[LEFT].tlen[i] = strlen (b->arr[LEFT].text[i]); + if (di->maxcols < b->arr[LEFT].tlen[i]) { + di->maxcols = b->arr[LEFT].tlen[i]; +@@ -300,7 +300,7 @@ DiffInfo *build_diff_info (char *prog, c + b->arr[RIGHT].wtext = (char **) calloc (b->arr[RIGHT].fsize, sizeof (char *)); + b->arr[RIGHT].tlen = (short *) calloc (b->arr[RIGHT].fsize, sizeof (short)); + for (i = 0; i < b->arr[RIGHT].fsize; i++) { +- getline (file2, &b->arr[RIGHT].text[i], &b->arr[RIGHT].wtext[i]); ++ get_line (file2, &b->arr[RIGHT].text[i], &b->arr[RIGHT].wtext[i]); + b->arr[RIGHT].tlen[i] = strlen (b->arr[RIGHT].text[i]); + if (di->maxcols < b->arr[RIGHT].tlen[i]) { + di->maxcols = b->arr[RIGHT].tlen[i]; +@@ -331,7 +331,7 @@ DiffInfo *build_diff_info (char *prog, c + b->arr[LEFT].wtext = (char **) calloc (b->arr[LEFT].fsize, sizeof (char *)); + b->arr[LEFT].tlen = (short *) calloc (b->arr[LEFT].fsize, sizeof (short)); + for (i = 0; i < b->arr[LEFT].fsize; i++) { +- getline (file1, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); ++ get_line (file1, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); + b->arr[LEFT].tlen[i] = strlen (b->arr[LEFT].text[i]); + if (di->maxcols < b->arr[LEFT].tlen[i]) { + di->maxcols = b->arr[LEFT].tlen[i]; +@@ -358,7 +358,7 @@ DiffInfo *build_diff_info (char *prog, c + b->arr[LEFT].wtext = (char **) calloc (b->arr[LEFT].fsize, sizeof (char *)); + b->arr[LEFT].tlen = (short *) calloc (b->arr[LEFT].fsize, sizeof (short)); + for (i = 0; i < b->arr[LEFT].fsize; i++) { +- getline (file1, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); ++ get_line (file1, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); + b->arr[LEFT].tlen[i] = strlen (b->arr[LEFT].text[i]); + if (di->maxcols < b->arr[LEFT].tlen[i]) { + di->maxcols = b->arr[LEFT].tlen[i]; +@@ -371,7 +371,7 @@ DiffInfo *build_diff_info (char *prog, c + b->arr[RIGHT].wtext = (char **) calloc (b->arr[RIGHT].fsize, sizeof (char *)); + b->arr[RIGHT].tlen = (short *) calloc (b->arr[RIGHT].fsize, sizeof (short)); + for (i = 0; i < b->arr[RIGHT].fsize; i++) { +- getline (file2, &b->arr[RIGHT].text[i], &b->arr[RIGHT].wtext[i]); ++ get_line (file2, &b->arr[RIGHT].text[i], &b->arr[RIGHT].wtext[i]); + b->arr[RIGHT].tlen[i] = strlen (b->arr[RIGHT].text[i]); + if (di->maxcols < b->arr[RIGHT].tlen[i]) { + di->maxcols = b->arr[RIGHT].tlen[i]; +@@ -399,7 +399,7 @@ DiffInfo *build_diff_info (char *prog, c + b->arr[LEFT].wtext = (char **) calloc (b->arr[LEFT].fsize, sizeof (char *)); + b->arr[LEFT].tlen = (short *) calloc (b->arr[LEFT].fsize, sizeof (short)); + for (i = 0; i < b->arr[LEFT].fsize; i++) { +- getline (file1, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); ++ get_line (file1, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); + b->arr[LEFT].tlen[i] = strlen (b->arr[LEFT].text[i]); + if (di->maxcols < b->arr[LEFT].tlen[i]) { + di->maxcols = b->arr[LEFT].tlen[i]; +@@ -428,7 +428,7 @@ DiffInfo *build_diff_info (char *prog, c + b->arr[LEFT].wtext = (char **) calloc (b->arr[LEFT].fsize, sizeof (char *)); + b->arr[LEFT].tlen = (short *) calloc (b->arr[LEFT].fsize, sizeof (short)); + for (i = 0; i < b->arr[LEFT].fsize; i++) { +- getline (file1, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); ++ get_line (file1, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); + b->arr[LEFT].tlen[i] = strlen (b->arr[LEFT].text[i]); + if (di->maxcols < b->arr[LEFT].tlen[i]) { + di->maxcols = b->arr[LEFT].tlen[i]; +@@ -491,7 +491,7 @@ DiffInfo *build_diff_info (char *prog, c + b->arr[LEFT].wtext = (char **) calloc (b->arr[LEFT].fsize, sizeof (char *)); + b->arr[LEFT].tlen = (short *) calloc (b->arr[LEFT].fsize, sizeof (short)); + for (i = 0; i < b->arr[LEFT].fsize; i++) { +- getline (file2, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); ++ get_line (file2, &b->arr[LEFT].text[i], &b->arr[LEFT].wtext[i]); + b->arr[LEFT].tlen[i] = strlen (b->arr[LEFT].text[i]); + if (di->maxcols < b->arr[LEFT].tlen[i]) { + di->maxcols = b->arr[LEFT].tlen[i]; +@@ -663,7 +663,7 @@ static int eatline (FILE *f) + * printable) if necessary. Silently truncate input lines at BUFSIZ + * characters. + */ +-static void getline (FILE *f, char **cooked, char **raw) ++static void get_line (FILE *f, char **cooked, char **raw) + { + char buffer[BUFSIZ+1]; + char *s; |