Merge remote-tracking branch 'mksh/master'
Conflicts: misc.c
This commit is contained in:
commit
224fd5aebe
2
exec.c
2
exec.c
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.186 2016/11/11 23:31:34 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.187 2016/11/12 03:54:48 tg Exp $");
|
||||||
|
|
||||||
#ifndef MKSH_DEFAULT_EXECSHELL
|
#ifndef MKSH_DEFAULT_EXECSHELL
|
||||||
#define MKSH_DEFAULT_EXECSHELL MKSH_UNIXROOT "/bin/sh"
|
#define MKSH_DEFAULT_EXECSHELL MKSH_UNIXROOT "/bin/sh"
|
||||||
|
16
misc.c
16
misc.c
@ -30,7 +30,7 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.249 2016/11/11 23:31:35 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.250 2016/11/12 03:54:48 tg Exp $");
|
||||||
|
|
||||||
#define KSH_CHVT_FLAG
|
#define KSH_CHVT_FLAG
|
||||||
#ifdef MKSH_SMALL
|
#ifdef MKSH_SMALL
|
||||||
@ -1550,15 +1550,11 @@ do_realpath(const char *upath)
|
|||||||
/* symlink target is an absolute path */
|
/* symlink target is an absolute path */
|
||||||
xp = Xstring(xs, xp);
|
xp = Xstring(xs, xp);
|
||||||
beginning_of_a_pathname:
|
beginning_of_a_pathname:
|
||||||
/* assert: (ip == ipath)[0] == '/' */
|
/* assert: mksh_cdirsep((ip == ipath)[0]) */
|
||||||
/* assert: xp == xs.beg => start of path */
|
/* assert: xp == xs.beg => start of path */
|
||||||
|
|
||||||
/* exactly two leading slashes? (SUSv4 3.266) */
|
/* exactly two leading slashes? (SUSv4 3.266) */
|
||||||
if (ip[1] == '/' && ip[2] != '/'
|
if (ip[1] == ip[0] && !mksh_cdirsep(ip[2])) {
|
||||||
#ifdef __OS2__
|
|
||||||
|| (mksh_cdirsep(ip[1]) && !mksh_cdirsep(ip[2]))
|
|
||||||
#endif
|
|
||||||
) {
|
|
||||||
/* keep them, e.g. for UNC pathnames */
|
/* keep them, e.g. for UNC pathnames */
|
||||||
Xput(xs, xp, '/');
|
Xput(xs, xp, '/');
|
||||||
}
|
}
|
||||||
@ -1727,11 +1723,7 @@ simplify_path(char *p)
|
|||||||
case '\\':
|
case '\\':
|
||||||
#endif
|
#endif
|
||||||
/* exactly two leading slashes? (SUSv4 3.266) */
|
/* exactly two leading slashes? (SUSv4 3.266) */
|
||||||
if (p[1] == '/' && p[2] != '/'
|
if (p[1] == p[0] && !mksh_cdirsep(p[2]))
|
||||||
#ifdef __OS2__
|
|
||||||
|| (mksh_cdirsep(p[1]) && !mksh_cdirsep(p[2]))
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
/* keep them, e.g. for UNC pathnames */
|
/* keep them, e.g. for UNC pathnames */
|
||||||
++p;
|
++p;
|
||||||
needslash = true;
|
needslash = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user