From 99db3ecb5c5de2b61c2eac3250178d2e0dd8458c Mon Sep 17 00:00:00 2001 From: tg Date: Wed, 11 Oct 2017 20:50:46 +0000 Subject: [PATCH] =?UTF-8?q?inline=20OS/2=E2=80=99s=20mksh=5Fsdirsep()=20in?= =?UTF-8?q?to=20its=20mksh=5Fvdirsep()=20because=20we=20must=20separate=20?= =?UTF-8?q?these=20two?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sh.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sh.h b/sh.h index 5e0b77a..eedab88 100644 --- a/sh.h +++ b/sh.h @@ -182,7 +182,7 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.842 2017/10/11 20:29:05 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.843 2017/10/11 20:50:46 tg Exp $"); #endif #define MKSH_VERSION "R56 2017/08/29" @@ -2753,7 +2753,12 @@ extern int tty_init_fd(void); /* initialise tty_fd, tty_devtty */ !mksh_cdirsep(mksh_sdirsep_s[2])) ? \ (mksh_sdirsep_s + 1) : strpbrk(mksh_sdirsep_s, "/\\"))); \ }) -#define mksh_vdirsep(s) (mksh_sdirsep((s)) != NULL) +#define mksh_vdirsep(s) __extension__({ \ + const char *mksh_vdirsep_s = (s); \ + ((char *)((mksh_drvltr(mksh_vdirsep_s) && \ + !mksh_cdirsep(mksh_vdirsep_s[2])) ? \ + (mksh_vdirsep_s + 1) : strpbrk(mksh_vdirsep_s, "/\\"))); \ +}) #else #define mksh_abspath(s) (ord((s)[0]) == ord('/')) #define mksh_cdirsep(c) (ord(c) == ord('/'))