version 1.48, 2014/12/08 21:59:36 |
version 1.49, 2014/12/13 10:31:07 |
|
|
while (filearg[0] == NULL) { |
while (filearg[0] == NULL) { |
if (force || batch) { |
if (force || batch) { |
say("No file to patch. Skipping...\n"); |
say("No file to patch. Skipping...\n"); |
filearg[0] = savestr(bestguess); |
filearg[0] = xstrdup(bestguess); |
skip_rest_of_patch = true; |
skip_rest_of_patch = true; |
return true; |
return true; |
} |
} |
ask("File to patch: "); |
ask("File to patch: "); |
if (*buf != '\n') { |
if (*buf != '\n') { |
free(bestguess); |
free(bestguess); |
bestguess = savestr(buf); |
bestguess = xstrdup(buf); |
filearg[0] = fetchname(buf, &exists, 0); |
filearg[0] = fetchname(buf, &exists, 0); |
} |
} |
if (!exists) { |
if (!exists) { |
|
|
else if (strnEQ(s, "Prereq:", 7)) { |
else if (strnEQ(s, "Prereq:", 7)) { |
for (t = s + 7; isspace((unsigned char)*t); t++) |
for (t = s + 7; isspace((unsigned char)*t); t++) |
; |
; |
revision = savestr(t); |
revision = xstrdup(t); |
for (t = revision; |
for (t = revision; |
*t && !isspace((unsigned char)*t); t++) |
*t && !isspace((unsigned char)*t); t++) |
; |
; |
|
|
free(bestguess); |
free(bestguess); |
bestguess = NULL; |
bestguess = NULL; |
if (filearg[0] != NULL) |
if (filearg[0] != NULL) |
bestguess = savestr(filearg[0]); |
bestguess = xstrdup(filearg[0]); |
else if (!ok_to_create_file) { |
else if (!ok_to_create_file) { |
/* |
/* |
* We don't want to create a new file but we need a |
* We don't want to create a new file but we need a |
|
|
path = names[NEW_FILE].path; |
path = names[NEW_FILE].path; |
} |
} |
|
|
return path ? savestr(path) : NULL; |
return path ? xstrdup(path) : NULL; |
} |
} |
|
|
static char * |
static char * |
|
|
names[NEW_FILE].path != NULL) |
names[NEW_FILE].path != NULL) |
best = names[NEW_FILE].path; |
best = names[NEW_FILE].path; |
} |
} |
return best ? savestr(best) : NULL; |
return best ? xstrdup(best) : NULL; |
} |
} |
|
|
static size_t |
static size_t |