Module Name: src Committed By: kamil Date: Thu Jun 22 13:32:04 UTC 2017
Modified Files: src/bin/ksh: c_ksh.c edit.c path.c sh.h Log Message: Remove ancient cygwin support in ksh(1) OK by <kre> To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/c_ksh.c cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/edit.c cvs rdiff -u -r1.8 -r1.9 src/bin/ksh/path.c cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/bin/ksh/c_ksh.c diff -u src/bin/ksh/c_ksh.c:1.18 src/bin/ksh/c_ksh.c:1.19 --- src/bin/ksh/c_ksh.c:1.18 Sun Oct 16 17:12:11 2011 +++ src/bin/ksh/c_ksh.c Thu Jun 22 13:32:04 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_ksh.c,v 1.18 2011/10/16 17:12:11 joerg Exp $ */ +/* $NetBSD: c_ksh.c,v 1.19 2017/06/22 13:32:04 kamil Exp $ */ /* * built-in Korn commands: c_* @@ -6,17 +6,13 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: c_ksh.c,v 1.18 2011/10/16 17:12:11 joerg Exp $"); +__RCSID("$NetBSD: c_ksh.c,v 1.19 2017/06/22 13:32:04 kamil Exp $"); #endif #include "sh.h" #include "ksh_stat.h" #include <ctype.h> -#ifdef __CYGWIN__ -#include <sys/cygwin.h> -#endif /* __CYGWIN__ */ - int c_cd(wp) char **wp; @@ -162,12 +158,7 @@ c_cd(wp) /* Set PWD */ if (pwd) { -#ifdef __CYGWIN__ - char ptmp[PATH]; /* larger than MAX_PATH */ - cygwin_conv_to_full_posix_path(pwd, ptmp); -#else /* __CYGWIN__ */ char *ptmp = pwd; -#endif /* __CYGWIN__ */ set_current_wd(ptmp); /* Ignore failure (happens if readonly or integer) */ setstr(pwd_s, ptmp, KSH_RETURN_ERROR); Index: src/bin/ksh/edit.c diff -u src/bin/ksh/edit.c:1.25 src/bin/ksh/edit.c:1.26 --- src/bin/ksh/edit.c:1.25 Sat Jun 5 03:02:37 2010 +++ src/bin/ksh/edit.c Thu Jun 22 13:32:04 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: edit.c,v 1.25 2010/06/05 03:02:37 sjg Exp $ */ +/* $NetBSD: edit.c,v 1.26 2017/06/22 13:32:04 kamil Exp $ */ /* * Command line editing - common code @@ -7,7 +7,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: edit.c,v 1.25 2010/06/05 03:02:37 sjg Exp $"); +__RCSID("$NetBSD: edit.c,v 1.26 2017/06/22 13:32:04 kamil Exp $"); #endif @@ -293,11 +293,6 @@ x_mode(onoff) set_tty(tty_fd, &cb, TF_WAIT); -#ifdef __CYGWIN__ - if (edchars.eof == '\0') - edchars.eof = '\4'; -#endif /* __CYGWIN__ */ - /* Convert unset values to internal `unset' value */ if (edchars.erase == vdisable_c) edchars.erase = -1; Index: src/bin/ksh/path.c diff -u src/bin/ksh/path.c:1.8 src/bin/ksh/path.c:1.9 --- src/bin/ksh/path.c:1.8 Sat Apr 25 05:11:37 2009 +++ src/bin/ksh/path.c Thu Jun 22 13:32:04 2017 @@ -1,8 +1,8 @@ -/* $NetBSD: path.c,v 1.8 2009/04/25 05:11:37 lukem Exp $ */ +/* $NetBSD: path.c,v 1.9 2017/06/22 13:32:04 kamil Exp $ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: path.c,v 1.8 2009/04/25 05:11:37 lukem Exp $"); +__RCSID("$NetBSD: path.c,v 1.9 2017/06/22 13:32:04 kamil Exp $"); #endif @@ -130,10 +130,10 @@ simplify_path(pathx) if ((isrooted = ISROOTEDPATH(pathx))) very_start++; -#if defined (OS2) || defined (__CYGWIN__) +#if defined (OS2) if (pathx[0] && pathx[1] == ':') /* skip a: */ very_start += 2; -#endif /* OS2 || __CYGWIN__ */ +#endif /* OS2 */ /* Before After * /foo/ /foo @@ -143,19 +143,13 @@ simplify_path(pathx) * .. .. * ./foo foo * foo/../../../bar ../../bar - * OS2 and CYGWIN: + * OS2: * a:/foo/../.. a:/ * a:. a: * a:.. a:.. * a:foo/../../blah a:../blah */ -#ifdef __CYGWIN__ - /* preserve leading double-slash on pathnames (for UNC paths) */ - if (pathx[0] && ISDIRSEP(pathx[0]) && pathx[1] && ISDIRSEP(pathx[1])) - very_start++; -#endif /* __CYGWIN__ */ - for (cur = t = start = very_start; ; ) { /* treat multiple '/'s as one '/' */ while (ISDIRSEP(*t)) Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.7 src/bin/ksh/sh.h:1.8 --- src/bin/ksh/sh.h:1.7 Sun Jun 26 19:09:00 2005 +++ src/bin/ksh/sh.h Thu Jun 22 13:32:04 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.7 2005/06/26 19:09:00 christos Exp $ */ +/* $NetBSD: sh.h,v 1.8 2017/06/22 13:32:04 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.7 2005/06/26 19:09:00 christos Exp $ */ +/* $Id: sh.h,v 1.8 2017/06/22 13:32:04 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -323,14 +323,8 @@ extern char *ksh_strrchr_dirsep(const ch # define DIRSEP '/' # define DIRSEPSTR "/" # define ISDIRSEP(c) ((c) == '/') -#ifdef __CYGWIN__ -# define ISABSPATH(s) \ - (((s)[0] && (s)[1] == ':' && ISDIRSEP((s)[2])) || ISDIRSEP((s)[0])) -# define ISRELPATH(s) (!(s)[0] || ((s)[1] != ':' && !ISDIRSEP((s)[0]))) -#else /* __CYGWIN__ */ # define ISABSPATH(s) ISDIRSEP((s)[0]) # define ISRELPATH(s) (!ISABSPATH(s)) -#endif /* __CYGWIN__ */ # define ISROOTEDPATH(s) ISABSPATH(s) # define FILECHCONV(c) c # define FILECMP(s1, s2) strcmp(s1, s2)