Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-08-28 00:11:11 +0400
committerChristopher Faylor <me@cgf.cx>2008-08-28 00:11:11 +0400
commit25687b0f76a010eecdbbce44aea5b2ba328a537e (patch)
treeff3c47cbe6ae4b0b7873bec1e4953c94dd3776b6
parent2d8d8175f1188b355dad77080e07ebc202d8cf37 (diff)
* cygcheck.cc (nuke): Use malloc rather than alloca for environment variables.
(load_cygwin): Ditto. * dump_setup.cc (parse_filename): Cosmetic changes. (get_packages): Ditto.
-rw-r--r--winsup/utils/ChangeLog8
-rw-r--r--winsup/utils/cygcheck.cc4
-rw-r--r--winsup/utils/dump_setup.cc9
3 files changed, 15 insertions, 6 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index b0d065642..26bf212b5 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-27 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * cygcheck.cc (nuke): Use malloc rather than alloca for environment
+ variables.
+ (load_cygwin): Ditto.
+ * dump_setup.cc (parse_filename): Cosmetic changes.
+ (get_packages): Ditto.
+
2008-08-25 Corinna Vinschen <corinna@vinschen.de>
* mkgroup.c (enum_local_groups): Don't skip printing groups when
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc
index fa24f8cf3..0fc27fcd2 100644
--- a/winsup/utils/cygcheck.cc
+++ b/winsup/utils/cygcheck.cc
@@ -2003,7 +2003,7 @@ void
nuke (char *ev)
{
int n = 1 + strchr (ev, '=') - ev;
- char *s = (char *) alloca (n + 1);
+ char *s = (char *) malloc (n + 1);
memcpy (s, ev, n);
s[n] = '\0';
putenv (s);
@@ -2051,7 +2051,7 @@ load_cygwin (int& argc, char **&argv)
}
for (char **ev = envp; *ev; ev++)
if (strncmp (*ev, "PATH=", 5) != 0)
- putenv (*ev);
+ putenv (strdup (*ev));
if (path)
putenv (path);
}
diff --git a/winsup/utils/dump_setup.cc b/winsup/utils/dump_setup.cc
index 9594eb1d5..3e71f1a02 100644
--- a/winsup/utils/dump_setup.cc
+++ b/winsup/utils/dump_setup.cc
@@ -94,14 +94,14 @@ parse_filename (const char *in_fn, fileparse& f)
if (*ver == '-')
if (isdigit (ver[1]))
{
- *ver++ = 0;
+ *ver++ = '\0';
strcpy (f.pkg, p);
break;
}
else if (strcasecmp (ver, "-src") == 0 ||
strcasecmp (ver, "-patch") == 0)
{
- *ver++ = 0;
+ *ver++ = '\0';
strcpy (f.pkg, p);
strcpy (f.what, strlwr (ver));
strcpy (f.pkgtar, p);
@@ -311,7 +311,8 @@ check_package_files (int verbose, char *package)
* The last entry in the list is {NULL,NULL}.
*/
static pkgver *
-get_packages (char **argv) {
+get_packages (char **argv)
+{
char *setup = cygpath ("/etc/setup/installed.db", NULL);
FILE *fp = fopen (setup, "rt");
@@ -352,7 +353,7 @@ get_packages (char **argv) {
if (len > package_len)
package_len = len;
packages[n].name = (char *) malloc (len + 1);
- strcpy (packages[n].name , package);
+ strcpy (packages[n].name, package);
if (f.what[0])
strcat (strcat (packages[n].name, "-"), f.what);
packages[n].ver = strdup (f.ver);