version 1.1, 2005/10/22 17:32:57 |
version 1.2, 2005/10/23 03:47:12 |
|
|
*/ |
*/ |
static struct diff *de; |
static struct diff *de; |
static char *overlap; |
static char *overlap; |
static int overlapcnt; |
static int overlapcnt = 0; |
static FILE *fp[3]; |
static FILE *fp[3]; |
static int cline[3]; /* # of the last-read line in each file (0-2) */ |
static int cline[3]; /* # of the last-read line in each file (0-2) */ |
|
|
|
|
return (-1); |
return (-1); |
} else if (op == 'c') { |
} else if (op == 'c') { |
if ((start > dlines->l_nblines) || |
if ((start > dlines->l_nblines) || |
(start < 0) || (*ep != ',')) |
(start < 0) || ((*ep != ',') && (*ep != 'c'))) |
return (-1); |
return (-1); |
|
|
ep++; |
if (*ep == ',') { |
end = (int)strtol(ep, &ep, 10); |
ep++; |
if ((end < 0) || (*ep != 'c')) |
end = (int)strtol(ep, &ep, 10); |
return (-1); |
if ((end < 0) || (*ep != 'c')) |
|
return (-1); |
|
} else { |
|
end = start; |
|
} |
} |
} |
|
|
|
|
for (;;) { |
for (;;) { |
if (dlp == NULL) |
if (dlp == NULL) |
break; |
break; |
|
|
if (dlp == NULL) |
if (dlp == NULL) |
return (-1); |
return (-1); |
|
|
|
|
if (op == 'c') { |
if (op == 'c') { |
for (i = start; i <= end; i++) { |
for (i = 0; i <= (end - start); i++) { |
ndlp = TAILQ_NEXT(dlp, l_list); |
ndlp = TAILQ_NEXT(dlp, l_list); |
TAILQ_REMOVE(&(dlines->l_lines), dlp, l_list); |
TAILQ_REMOVE(&(dlines->l_lines), dlp, l_list); |
dlp = ndlp; |
dlp = ndlp; |
} |
} |
|
dlp = TAILQ_PREV(dlp, cvs_tqh, l_list); |
} |
} |
|
|
if (op == 'a' || op == 'c') { |
if (op == 'a' || op == 'c') { |
|
|
edscript(int n) |
edscript(int n) |
{ |
{ |
int j, k; |
int j, k; |
char block[BUFSIZ]; |
char block[BUFSIZ+1]; |
|
|
for (n = n; n > 0; n--) { |
for (n = n; n > 0; n--) { |
if (!oflag || !overlap[n]) |
if (!oflag || !overlap[n]) |
|
|
block[j] = '\0'; |
block[j] = '\0'; |
diff_output("%s", block); |
diff_output("%s", block); |
} |
} |
|
|
if (!oflag || !overlap[n]) |
if (!oflag || !overlap[n]) |
diff_output(".\n"); |
diff_output(".\n"); |
else { |
else { |