Joe Filion <joefilion4@gmail.com> noted that the string is modified,
and Henrik Carlqvist <hc94@poolhem.se> noticed that it wasn't put
back in all cases.
char *
tilde_expand (const char *name)
{
-#ifndef VMS
+#if !defined(VMS)
if (name[1] == '/' || name[1] == '\0')
{
char *home_dir;
{
if (userend == 0)
return xstrdup (pwent->pw_dir);
- else
- return xstrdup (concat (3, pwent->pw_dir, "/", userend + 1));
+
+ *userend = '/';
+ return xstrdup (concat (3, pwent->pw_dir, "/", userend + 1));
}
else if (userend != 0)
*userend = '/';