This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: [setup] ini in same dir as package - 'base' is one off. (+ patch)
- From: Bas van Gompel <cygwin-apps dot buzz at bavag dot tmfweb dot nl>
- To: cygwin-apps at cygwin dot com
- Date: Thu, 23 Sep 2004 02:39:17 +0200 (MET DST)
- Subject: Re: [setup] ini in same dir as package - 'base' is one off. (+ patch)
- Organisation: Ehm...
- References: <n2m-g.c2djee.3vv8h7h.1@buzzy-box.bavag>
- Reply-to: cygwin-apps mailing-list <cygwin-apps at cygwin dot com>
Ehh... Ping (-c 2)
Op Sat, 6 Mar 2004 22:35:37 +0100 (MET) schreef ik
in <n2m-g.c2djee.3vv8h7h.1@buzzy-box.bavag>:
[One-off in package_source.cc]
: A patch against the current cvs version (2.8) for this follows.
(It also prevents unpredictable (by me) behaviour if a setup.ini
would contain an empty "install: " line.)
(Slightly altered) Changelog-Entry:
2004-09-23 Bas van Gompel <cygsup-patch.buzz@bavag.tmfweb.nl>
* package_source.cc (packagesource::set_canonical): Fix one-off in
'base' when ini is in same dir as package.
The patch, once more, as it has been a while:
--- setup/package_source.cc 18 Feb 2002 12:35:22 -0000 2.8
+++ setup/package_source.cc 22 Sep 2004 21:48:18 -0000
@@ -44,7 +44,9 @@ packagesource::set_canonical (char const
while (bstart && (tmp = strchr (bstart + 1, '/')))
bstart = tmp;
- if (!bstart)
+ if (bstart)
+ bstart++;
+ else
bstart = fn;
char const *bend = strchr (bstart, '-');
while (bend && (tmp = strchr (bend + 1, '-')))
@@ -59,15 +61,15 @@ packagesource::set_canonical (char const
char const *end = strchr (fn, '\0');
if (base)
delete[] base;
- base = new char[bend - bstart];
- memcpy (base, bstart + 1, bend - bstart - 1);
- base[bend - bstart - 1] = '\0';
+ base = new char[bend - bstart + 1];
+ memcpy (base, bstart, bend - bstart);
+ base[bend - bstart] = '\0';
if (filename)
delete[] filename;
- filename = new char[end - bstart];
- memcpy (filename, bstart + 1, end - bstart - 1);
- filename[end - bstart - 1] = '\0';
+ filename = new char[end - bstart + 1];
+ memcpy (filename, bstart, end - bstart);
+ filename[end - bstart] = '\0';
cached = String();
}
L8r,
Buzz.
--
) | | ---/ ---/ Yes, this | This message consists of true | I do not
-- | | / / really is | and false bits entirely. | mail for
) | | / / a 72 by 4 +-------------------------------+ any1 but
-- \--| /--- /--- .sigfile. | |perl -pe "s.u(z)\1.as." | me. 4^re