version 1.5, 2005/12/27 04:31:06 |
version 1.6, 2005/12/27 04:33:31 |
|
|
*/ |
*/ |
argc_max = argc * 2; |
argc_max = argc * 2; |
if (!(diffargv = malloc(sizeof(char **) * argc_max))) |
if (!(diffargv = malloc(sizeof(char **) * argc_max))) |
err(2, "out of memory"); |
err(2, "main"); |
|
|
/* Add first argument, the program name. */ |
/* Add first argument, the program name. */ |
diffargv[diffargc++] = diffprog; |
diffargv[diffargc++] = diffprog; |
|
|
struct diffline *diffp; |
struct diffline *diffp; |
|
|
if (!(diffp = malloc(sizeof(struct diffline)))) |
if (!(diffp = malloc(sizeof(struct diffline)))) |
err(2, "could not allocate memory"); |
err(2, "enqueue"); |
diffp->left = left; |
diffp->left = left; |
diffp->div = div; |
diffp->div = div; |
diffp->right = right; |
diffp->right = right; |
|
|
*/ |
*/ |
if (!*s) { |
if (!*s) { |
if (!(*s = strdup(append))) |
if (!(*s = strdup(append))) |
err(2, "could not allocate memory"); |
err(2, "astrcat"); |
|
|
/* Keep track of string. */ |
/* Keep track of string. */ |
offset = strlen(*s); |
offset = strlen(*s); |
|
|
/* Resize *s to fit new string. */ |
/* Resize *s to fit new string. */ |
newstr = realloc(*s, newlen); |
newstr = realloc(*s, newlen); |
if (newstr == NULL) |
if (newstr == NULL) |
err(2, "could not allocate memory"); |
err(2, "astrcat"); |
*s = newstr; |
*s = newstr; |
|
|
/* Concatenate. */ |
/* Concatenate. */ |
|
|
|
|
/* Add to delete queue. */ |
/* Add to delete queue. */ |
if (!(linep = malloc(sizeof(struct fileline)))) |
if (!(linep = malloc(sizeof(struct fileline)))) |
err(2, "could not allocate memory"); |
err(2, "printc"); |
linep->line = line1; |
linep->line = line1; |
SIMPLEQ_INSERT_TAIL(&delqhead, linep, fileentries); |
SIMPLEQ_INSERT_TAIL(&delqhead, linep, fileentries); |
} |
} |