The following commit has been merged in the master branch:
commit 4aadfe74c5cce5a6acc45e1527d64583ee1b4d45
Author: Guillem Jover <[email protected]>
Date: Sun Sep 11 05:14:30 2011 +0200
dpkg-split: Do not include trailing slash in PARTSDIR
diff --git a/dpkg-split/dpkg-split.h b/dpkg-split/dpkg-split.h
index 4f3cf6c..2f7387e 100644
--- a/dpkg-split/dpkg-split.h
+++ b/dpkg-split/dpkg-split.h
@@ -73,7 +73,7 @@ void addtopartlist(struct partinfo**, struct partinfo*,
struct partinfo *refi);
#define SPLITVERSION "2.1"
-#define PARTSDIR "parts/"
+#define PARTSDIR "parts"
#define PARTMAGIC "debian-split"
#define HEADERALLOWANCE 1024
diff --git a/dpkg-split/main.c b/dpkg-split/main.c
index c4e7b33..9b8b09a 100644
--- a/dpkg-split/main.c
+++ b/dpkg-split/main.c
@@ -151,8 +151,6 @@ static const struct cmdinfo cmdinfos[]= {
int main(int argc, const char *const *argv) {
int ret;
- int l;
- char *p;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
@@ -164,14 +162,6 @@ int main(int argc, const char *const *argv) {
if (!cipaction) badusage(_("need an action option"));
- l = strlen(opt_depotdir);
- if (l && opt_depotdir[l - 1] != '/') {
- p= nfmalloc(l+2);
- strcpy(p, opt_depotdir);
- strcpy(p+l,"/");
- opt_depotdir = p;
- }
-
setvbuf(stdout,NULL,_IONBF,0);
ret = cipaction->action(argv);
diff --git a/dpkg-split/queue.c b/dpkg-split/queue.c
index e758feb..748f16c 100644
--- a/dpkg-split/queue.c
+++ b/dpkg-split/queue.c
@@ -98,9 +98,8 @@ void scandepot(void) {
pq->info.arch = NULL;
pq->info.orglength= pq->info.thispartoffset= pq->info.thispartlen= 0;
pq->info.headerlen= 0;
- p = nfmalloc(strlen(opt_depotdir) + strlen(de->d_name) + 1);
- strcpy(p, opt_depotdir);
- strcat(p,de->d_name);
+ p = nfmalloc(strlen(opt_depotdir) + 1 + strlen(de->d_name) + 1);
+ sprintf(p, "%s/%s", opt_depotdir, de->d_name);
pq->info.filename= p;
if (!decompose_filename(de->d_name,pq)) {
pq->info.md5sum= NULL;
@@ -171,8 +170,8 @@ do_auto(const char *const *argv)
int ap;
char *p, *q;
- m_asprintf(&p, "%st.%lx", opt_depotdir, (long)getpid());
- m_asprintf(&q, "%s%s.%jx.%x.%x", opt_depotdir, refi->md5sum,
+ m_asprintf(&p, "%s/t.%lx", opt_depotdir, (long)getpid());
+ m_asprintf(&q, "%s/%s.%jx.%x.%x", opt_depotdir, refi->md5sum,
(intmax_t)refi->maxpartlen, refi->thispartn, refi->maxpartn);
fd_src = open(partfile, O_RDONLY);
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]