1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-04 15:43:04 +00:00

Use getcwd() instead of getwd(). (#20)

getwd() has been deprecated for a long time and getcwd() should
be used instead.
This commit is contained in:
Bruce Mitchener
2020-12-11 00:24:21 +07:00
committed by GitHub
parent 11c083d792
commit d6d2a3371a
2 changed files with 3 additions and 7 deletions

View File

@@ -552,7 +552,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
* "..>" or ".." means the parent directory of the
* user's current working directory.
*/
if (getwd(dst) == 0) return (0);
if (getcwd(dst, MAXPATHLEN) == 0) return (0);
#ifdef DOS
dp = max(strrchr(dst, '/'), strrchr(dst, DIRSEP));
#else
@@ -575,7 +575,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
#endif
case '>':
/* ".>" means the user's current working directory. */
if (getwd(dst) == 0) return (0);
if (getcwd(dst, MAXPATHLEN) == 0) return (0);
while (*dp != '\0') dp++;
*dp++ = DIRSEP;
@@ -584,7 +584,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
case '\0':
/* "." also means the user's current working directory. */
if (getwd(dst) == 0) return (0);
if (getcwd(dst, MAXPATHLEN) == 0) return (0);
while (*dp != '\0') dp++;
*dp++ = DIRSEP;