un-OS/2 (sorry)

no binary change
This commit is contained in:
tg
2004-12-13 19:05:09 +00:00
parent 978a1d53a1
commit c34add61ff
19 changed files with 47 additions and 483 deletions

29
c_ksh.c
View File

@@ -1,4 +1,4 @@
/** $MirBSD: src/bin/ksh/c_ksh.c,v 2.1 2004/12/10 18:09:40 tg Exp $ */
/** $MirBSD: src/bin/ksh/c_ksh.c,v 2.2 2004/12/13 19:05:08 tg Exp $ */
/* $OpenBSD: c_ksh.c,v 1.18 2004/02/10 13:03:36 jmc Exp $ */
/*
@@ -13,7 +13,7 @@
#include <sys/cygwin.h>
#endif /* __CYGWIN__ */
__RCSID("$MirBSD: src/bin/ksh/c_ksh.c,v 2.1 2004/12/10 18:09:40 tg Exp $");
__RCSID("$MirBSD: src/bin/ksh/c_ksh.c,v 2.2 2004/12/13 19:05:08 tg Exp $");
int
c_cd(char **wp)
@@ -139,15 +139,7 @@ c_cd(char **wp)
setstr(oldpwd_s, current_wd, KSH_RETURN_ERROR);
if (!ISABSPATH(Xstring(xs, xp))) {
#ifdef OS2
/* simplify_path() doesn't know about os/2's drive contexts,
* so it can't set current_wd when changing to a:foo.
* Handle this by calling getcwd()...
*/
pwd = ksh_get_wd((char *) 0, 0);
#else /* OS2 */
pwd = (char *) 0;
#endif /* OS2 */
} else
#ifdef S_ISLNK
if (!physical || !(pwd = get_phys_path(Xstring(xs, xp))))
@@ -228,7 +220,6 @@ c_print(char **wp)
#define PO_PMINUSMINUS BIT(2) /* print a -- argument */
#define PO_HIST BIT(3) /* print to history instead of stdout */
#define PO_COPROC BIT(4) /* printing to coprocess: block SIGPIPE */
#define PO_FSLASH BIT(5) /* swap slash for backslash (for os2 ) */
int fd = 1;
int flags = PO_EXPAND|PO_NL;
char *s;
@@ -269,11 +260,7 @@ c_print(char **wp)
}
} else {
int optc;
#if OS2
const char *options = "Rnpfrsu,"; /* added f flag */
#else
const char *options = "Rnprsu,";
#endif
while ((optc = ksh_getopt(wp, &builtin_opt, options)) != EOF)
switch (optc) {
case 'R': /* fake BSD echo command */
@@ -284,11 +271,6 @@ c_print(char **wp)
case 'e':
flags |= PO_EXPAND;
break;
#ifdef OS2
case 'f':
flags |= PO_FSLASH;
break;
#endif
case 'n':
flags &= ~PO_NL;
break;
@@ -334,13 +316,6 @@ c_print(char **wp)
s = *wp;
while ((c = *s++) != '\0') {
Xcheck(xs, xp);
#ifdef OS2
if ((flags & PO_FSLASH) && c == '\\')
if (*s == '\\')
*s++;
else
c = '/';
#endif /* OS2 */
if ((flags & PO_EXPAND) && c == '\\') {
int i;