@@ -887,6 +887,7 @@
switch (c) {
case '[':
- case NOT:
+ case '!':
+ case NOT2:
case '-':
case ']':
if (!in_bracket) {
saw_glob = true;
in_bracket = true;
-- if (ISMAGIC(p[1]) && p[2] == NOT)
-+ if (ISMAGIC(p[1]) && (p[2] == NOT || p[2] == NOT2))
+- if (ISMAGIC(p[1]) && p[2] == '!')
++ if (ISMAGIC(p[1]) && (p[2] == '!' || p[2] == NOT2))
p += 2;
if (ISMAGIC(p[1]) && p[2] == ']')
p += 2;
int c, d, notp, found = 0;
const unsigned char *orig_p = p;
-- if ((notp = (ISMAGIC(*p) && *++p == NOT)))
-+ if ((notp = (ISMAGIC(*p) && (*++p == NOT || *p == NOT2))))
+- if ((notp = (ISMAGIC(*p) && *++p == '!')))
++ if ((notp = (ISMAGIC(*p) && (*++p == '!' || *p == NOT2))))
p++;
do {
c = *p++;
diff -ur mksh-40.org//sh.h mksh-40/sh.h
--- mksh-40.org//sh.h 2011-06-12 16:59:09.000000000 +0200
+++ mksh-40/sh.h 2011-07-07 18:29:16.346761511 +0200
-@@ -380,6 +380,7 @@
+@@ -380,5 +380,6 @@
#define MAGIC (7) /* prefix for *?[!{,} during expand */
#define ISMAGIC(c) ((unsigned char)(c) == MAGIC)
- #define NOT '!' /* might use ^ (ie, [!...] vs [^..]) */
+#define NOT2 '^'
#define LINE 4096 /* input line size */
case CHAR:
c = *wp++;
if ((opmode & WDS_MAGIC) &&
-- (ISMAGIC(c) || c == '[' || c == NOT ||
-+ (ISMAGIC(c) || c == '[' || c == NOT || c == NOT2 ||
+- (ISMAGIC(c) || c == '[' || c == '!' ||
++ (ISMAGIC(c) || c == '[' || c == '!' || c == NOT2 ||
c == '-' || c == ']' || c == '*' || c == '?'))
shf_putc(MAGIC, shf);
shf_putc(c, shf);
+++ /dev/null
-diff -u -p -u -p -r1.522 sh.h
---- sh.h 3 Mar 2012 21:31:21 -0000 1.522
-+++ sh.h 9 Mar 2012 15:14:49 -0000
-@@ -855,7 +855,7 @@ EXTERN char *current_wd;
- */
- #define MIN_COLS (2 + MIN_EDIT_SPACE + 3)
- #define MIN_LINS 3
--EXTERN mksh_ari_t x_cols E_INIT(80); /* tty columns */
-+EXTERN mksh_ari_t x_cols E_INIT(-1); /* tty columns */
- EXTERN mksh_ari_t x_lins E_INIT(-1); /* tty lines */
-
- /* These to avoid bracket matching problems */
-diff -u -p -u -p -r1.141 var.c
---- var.c 3 Mar 2012 21:31:23 -0000 1.141
-+++ var.c 9 Mar 2012 15:14:49 -0000
-@@ -1458,14 +1458,13 @@ set_array(const char *var, bool reset, c
- void
- change_winsz(void)
- {
-- if (x_lins < 0) {
-+ if (x_cols < 0 && x_lins < 0) {
- /* first time initialisation */
- #ifdef TIOCGWINSZ
- if (tty_fd < 0)
- /* non-FTALKING, try to get an fd anyway */
- tty_init(true, false);
- #endif
-- x_cols = -1;
- }
-
- #ifdef TIOCGWINSZ
# http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout:
-- @(#)MIRBSD KSH R40 2011/12/11
-+ @(#)MIRBSD KSH R40 2011/12/11 @DISTRO@
+- @(#)MIRBSD KSH R40 2012/03/20
++ @(#)MIRBSD KSH R40 2012/03/20 @DISTRO@
description:
Check version of shell.
stdin:
+++ mksh/sh.h 2011-07-12 08:01:04.445312267 +0200
@@ -153,7 +153,7 @@
#ifdef EXTERN
- __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.484.2.11 2011/12/11 18:18:28 tg Exp $");
+ __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.484.2.16 2012/03/24 21:22:43 tg Exp $");
#endif
--#define MKSH_VERSION "R40 2011/12/11"
-+#define MKSH_VERSION "R40 2011/12/11 @DISTRO@"
-
- #ifndef MKSH_INCLUDES_ONLY
+-#define MKSH_VERSION "R40 2012/03/20"
++#define MKSH_VERSION "R40 2012/03/20 @DISTRO@"
+ /* arithmetic types: C implementation */
+ #if !HAVE_CAN_INTTYPES
--- /dev/null
+commit 04ac6ad16336a70603c4817d678f9a1eddd18c74
+Author: tg <tg>
+Date: Sun Mar 25 14:28:11 2012 +0000
+
+ fix regression w.r.t. TTY and external programmes:
+ • release the TTY after the initial change_winsz()
+ • since we release it, we can skip initialising tty_state, too
+
+diff --git a/main.c b/main.c
+index 8022782..0405b1b 100644
+--- a/main.c
++++ b/main.c
+@@ -252,8 +252,9 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
+
+ #ifdef TIOCGWINSZ
+ /* try to initialise tty size before importing environment */
+- tty_init(true, false);
++ tty_init(false, false);
+ change_winsz();
++ tty_close();
+ #endif
+
+ #ifdef _PATH_DEFPATH
Summary: MirBSD Korn Shell
Summary(pl.UTF-8): Powłoka Korna z MirBSD
Name: mksh
-Version: 40d
-Release: 3
+Version: 40e
+Release: 1
License: BSD
Group: Applications/Shells
Source0: http://www.mirbsd.org/MirOS/dist/mir/mksh/%{name}-R%{version}.cpio.gz
-# Source0-md5: c6428401103367730a95b99284bf47dc
+# Source0-md5: d9a2df50c09692fc24d52ee9cf3bb789
Source1: %{name}-mkshrc
Patch0: %{name}-mkshrc_support.patch
Patch1: %{name}-circumflex.patch
Patch2: %{name}-no_stop_alias.patch
Patch3: %{name}-distro.patch
Patch4: %{name}-cmdline-length.patch
-Patch5: %{name}-columns.patch
+Patch5: %{name}-tty_close.patch
URL: https://www.mirbsd.org/mksh.htm
%if %{with tests}
BuildRequires: ed
%patch2 -p1
%patch3 -p1
%patch4 -p1
-%patch5 -p0
+%patch5 -p1
sed -i -e 's#@DISTRO@#PLD/Linux 3.0#g' check.t sh.h