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
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-01-16 13:25:58 +0300
committerCorinna Vinschen <corinna@vinschen.de>2010-01-16 13:25:58 +0300
commit1b526b480b08c75483b56ff34bab8f0d643081cc (patch)
treee0375d8d2b5167807b872627c2671f95eb221396 /winsup
parent1a8d1e10400b117a6a0a75d7991768d14597b863 (diff)
* cygpath.cc (get_mixed_name): Drop function. Replace with call to
convert_slashes throughout. (do_sysfolders): Free allocated buffer. (do_pathconv): Fix freeing last buffer.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/utils/ChangeLog7
-rw-r--r--winsup/utils/cygpath.cc43
2 files changed, 15 insertions, 35 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index ba588d5ad..e33d8f2b0 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygpath.cc (get_mixed_name): Drop function. Replace with call to
+ convert_slashes throughout.
+ (do_sysfolders): Free allocated buffer.
+ (do_pathconv): Fix freeing last buffer.
+
2010-01-11 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (do_mount_from_fstab): Allow to change cygdrive prefix, too.
diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc
index 02b490902..2b9fed419 100644
--- a/winsup/utils/cygpath.cc
+++ b/winsup/utils/cygpath.cc
@@ -539,22 +539,6 @@ convert_slashes (char* name)
}
}
-static char *
-get_mixed_name (const char* filename)
-{
- char* mixed_buf = strdup (filename);
-
- if (mixed_buf == NULL)
- {
- fprintf (stderr, "%s: out of memory\n", prog_name);
- exit (1);
- }
-
- convert_slashes (mixed_buf);
-
- return mixed_buf;
-}
-
static bool
get_special_folder (char* path, int id)
{
@@ -575,6 +559,7 @@ static void
do_sysfolders (char option)
{
char *buf, buf1[PATH_MAX], buf2[PATH_MAX];
+ char *tmp = NULL;
WCHAR wbuf[MAX_PATH];
DWORD len = MAX_PATH;
WIN32_FIND_DATAW w32_fd;
@@ -667,20 +652,14 @@ do_sysfolders (char option)
}
else
{
- char *tmp;
-
if (shortname_flag)
- {
- buf = get_short_name (tmp = buf);
- free (tmp);
- }
+ tmp = buf = get_short_name (buf);
if (mixed_flag)
- {
- buf = get_mixed_name (tmp = buf);
- free (tmp);
- }
+ convert_slashes (buf);
}
printf ("%s\n", buf);
+ if (tmp)
+ free (tmp);
}
static void
@@ -759,10 +738,7 @@ do_pathconv (char *filename)
free (tmp);
}
if (mixed_flag)
- {
- buf = get_mixed_name (tmp = buf);
- free (tmp);
- }
+ convert_slashes (buf);
}
if (err)
{
@@ -812,10 +788,7 @@ do_pathconv (char *filename)
}
}
if (mixed_flag)
- {
- buf = get_mixed_name (buf);
- free (tmp);
- }
+ convert_slashes (buf);
}
}
@@ -823,7 +796,7 @@ do_pathconv (char *filename)
if (buf2)
free (buf2);
if (buf)
- free (buf);
+ free (tmp);
}
static void