176 |
|
(void)snprintf(file, FILENAME_MAX, "%s/%s", cwd, e->data); |
177 |
|
} |
178 |
|
|
179 |
+ |
if (e->type == ASSET_SAMPLE) { |
180 |
+ |
for (int ch = 0; ch < FILENAME_MAX; ch++) { |
181 |
+ |
if (file[ch] == '\0') |
182 |
+ |
break; |
183 |
+ |
if (file[ch] == ' ' || file[ch] == '\t') |
184 |
+ |
file[ch] = '\0'; |
185 |
+ |
} |
186 |
+ |
} |
187 |
+ |
|
188 |
|
if (lstat(file, &st) != 0) { |
189 |
|
sqlite3_finalize(stmnt); |
190 |
|
RETURN_ERRORX(MPORT_ERR_FATAL, "Could not stat %s: %s", file, strerror(errno)); |
565 |
|
(void) snprintf(filename, FILENAME_MAX, "%s%s", extra->sourcedir, e->data); |
566 |
|
} else { |
567 |
|
(void) snprintf(filename, FILENAME_MAX, "%s/%s/%s", extra->sourcedir, cwd, e->data); |
568 |
+ |
} |
569 |
+ |
|
570 |
+ |
if (e->type == ASSET_SAMPLE) { |
571 |
+ |
// eat the second filename if it exists. |
572 |
+ |
for (int ch = 0; ch < FILENAME_MAX; ch++) { |
573 |
+ |
if (filename[ch] == '\0') |
574 |
+ |
break; |
575 |
+ |
if (filename[ch] == ' ' || filename[ch] == '\t') { |
576 |
+ |
filename[ch] = '\0'; |
577 |
+ |
break; |
578 |
+ |
} |
579 |
+ |
} |
580 |
|
} |
581 |
|
|
582 |
|
if (mport_bundle_write_add_file(bundle, filename, e->data) != MPORT_OK) |