+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.
}
}
-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)
{
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;
}
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
free (tmp);
}
if (mixed_flag)
- {
- buf = get_mixed_name (tmp = buf);
- free (tmp);
- }
+ convert_slashes (buf);
}
if (err)
{
}
}
if (mixed_flag)
- {
- buf = get_mixed_name (buf);
- free (tmp);
- }
+ convert_slashes (buf);
}
}
if (buf2)
free (buf2);
if (buf)
- free (buf);
+ free (tmp);
}
static void