From e46197af04ed2c7641927c768e5ba971a868057c Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Mon, 25 Oct 1999 11:20:48 +0000 Subject: [PATCH] * main/processarc.c: fixes calculation of package filename display (the ".../foo.deb" one) where it was showing the full path if the basename was longer than 30 chars. Now shows just the basename if it can't squeez the full path to < 30 chars (even if the basename is > than 30 chars) --- ChangeLog | 8 ++++++++ main/processarc.c | 10 ++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d722296..08457a3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Oct 25 06:50:17 EDT 1999 Ben Collins + + * main/processarc.c: fixes calculation of package filename display (the + ".../foo.deb" one) where it was showing the full path if the basename + was longer than 30 chars. Now shows just the basename if it can't + squeez the full path to < 30 chars (even if the basename is > than 30 + chars) + Sun Oct 24 20:46:44 EDT 1999 Ben Collins * scripts/dpkg-source.pl: we want to 'delete' the POSIXLY_CORRECT env diff --git a/main/processarc.c b/main/processarc.c index ce413c81..91672c17 100644 --- a/main/processarc.c +++ b/main/processarc.c @@ -68,7 +68,7 @@ void process_archive(const char *filename) { struct pkginfo *pkg, *otherpkg, *divpkg; struct conflict *conflictor, *cflict; char *cidir, *cidirrest, *p; - char pfilenamebuf[35], conffilenamebuf[MAXCONFFILENAME]; + char *pfilenamebuf, conffilenamebuf[MAXCONFFILENAME]; const char *pfilename, *newinfofilename; struct fileinlist *newconff, **newconffileslastp; struct fileinlist *cfile; @@ -88,13 +88,11 @@ void process_archive(const char *filename) { cleanup_pkg_failed= cleanup_conflictor_failed= 0; admindirlen= strlen(admindir); - pfilename= filename; - while (strlen(pfilename) > sizeof(pfilenamebuf)-5) { + for (pfilename= filename ; pfilename && strlen(pfilename) > 30 && + strchr(pfilename,'/') != NULL ; pfilename++ ) pfilename= strchr(pfilename,'/'); - if (!pfilename) break; - pfilename++; - } if (pfilename && pfilename != filename) { + pfilenamebuf= (char *)nfmalloc(strlen(pfilename)+5); strcpy(pfilenamebuf,".../"); strcat(pfilenamebuf,pfilename); pfilename= pfilenamebuf; -- 2.39.5