aboutsummaryrefslogtreecommitdiff
path: root/lib/manifest.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2020-06-23 00:22:29 -0400
committerGitHub <noreply@github.com>2020-06-23 00:22:29 -0400
commitfa17600efcd09bf74954e728047fded3ff0bd0cd (patch)
tree33a5a5a608aaba2752ee3f2188370d315b15864a /lib/manifest.c
parent62db2a4054a55883e7476750c925cb9d5a72fbc5 (diff)
parent155b25db75ecad4b19fd9a36b1aad64d436925dc (diff)
downloadspmc-fa17600efcd09bf74954e728047fded3ff0bd0cd.tar.gz
Merge pull request #48 from jhunkeler/no-auto-repo_target
Move SPM_GLOBAL.repo_target string usage out of mirror_clone
Diffstat (limited to 'lib/manifest.c')
-rw-r--r--lib/manifest.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/manifest.c b/lib/manifest.c
index f84867d..cd51b97 100644
--- a/lib/manifest.c
+++ b/lib/manifest.c
@@ -388,25 +388,17 @@ Manifest *manifest_read(char *file_or_url) {
strcpy(path, SPM_GLOBAL.package_dir);
}
else {
- tmpdir = spm_mkdtemp(TMP_DIR, "spm_manifest_read_XXXXXX", SPM_GLOBAL.repo_target);
+ tmpdir = spm_mkdtemp(TMP_DIR, "spm_manifest_read_XXXXXX", NULL);
if (exists(tmpdir) != 0) {
fprintf(stderr, "Failed to create temporary storage directory\n");
fprintf(SYSERROR);
return NULL;
}
- snprintf(pathptr, PATH_MAX - 1, "%s%s%s%s%s", tmpdir, DIRSEPS, SPM_GLOBAL.repo_target, DIRSEPS, filename);
+ pathptr = join((char *[]) {tmpdir, filename, NULL}, DIRSEPS);
}
- const char *target_is;
- if (strstr(file_or_url, SPM_GLOBAL.repo_target) != NULL) {
- target_is = "";
- }
- else {
- target_is = SPM_GLOBAL.repo_target;
- }
-
- char *remote_manifest = join_ex(DIRSEPS, file_or_url, target_is, filename, NULL);
+ char *remote_manifest = join_ex(DIRSEPS, file_or_url, filename, NULL);
if (exists(pathptr) != 0) {
// TODO: Move this out