Skip to content

Commit

Permalink
Fix some installation problems with samples that have an absolute pre…
Browse files Browse the repository at this point in the history
…fix. (firebird-server)
  • Loading branch information
laffer1 committed Jan 1, 2020
1 parent ba4cbad commit d9407d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/libmport/bundle_read_install_pkg.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ create_sample_file(mportInstance *mport, char *cwd, const char *file)
char nonSample[FILENAME_MAX * 2];
char secondFile[FILENAME_MAX];

strlcpy(nonSample, file, FILENAME_MAX * 2);
(void) snprintf(nonSample, FILENAME_MAX, "%s%s/%s", mport->root, cwd, file);
if (file[0] != '/')
(void) snprintf(nonSample, FILENAME_MAX, "%s%s/%s", mport->root, cwd, file);
else
strlcpy(nonSample, file, FILENAME_MAX * 2);
char** fileargv = parse_sample(nonSample);

if (fileargv[1] != '\0') {
Expand Down Expand Up @@ -497,7 +499,11 @@ do_actual_install(mportInstance *mport, mportBundleRead *bundle, mportPackageMet
if (mport_bundle_read_next_entry(bundle, &entry) != MPORT_OK)
goto ERROR;

(void) snprintf(file, FILENAME_MAX, "%s%s/%s", mport->root, cwd, e->data);
if (e->data[0] == '/') {
(void) snprintf(file, FILENAME_MAX, "%s", e->data);
} else {
(void) snprintf(file, FILENAME_MAX, "%s%s/%s", mport->root, cwd, e->data);
}

if (e->type == ASSET_SAMPLE)
for (int ch = 0; ch < FILENAME_MAX; ch++) {
Expand Down

0 comments on commit d9407d8

Please sign in to comment.