Merge remote-tracking branch 'mksh/master'

This commit is contained in:
KO Myung-Hun 2015-10-26 11:24:15 +09:00
commit 788fdcd188
5 changed files with 50 additions and 11 deletions

33
check.t
View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.710 2015/10/09 21:36:52 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.712 2015/10/24 19:46:07 tg Exp $
# -*- mode: sh -*-
#-
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
@ -30,7 +30,7 @@
# (2013/12/02 20:39:44) http://openbsd.cs.toronto.edu/cgi-bin/cvsweb/src/regress/bin/ksh/?sortby=date
expected-stdout:
@(#)MIRBSD KSH R51 2015/10/09
@(#)MIRBSD KSH R51 2015/10/24
description:
Check version of shell.
stdin:
@ -39,7 +39,7 @@ name: KSH_VERSION
category: shell:legacy-no
---
expected-stdout:
@(#)LEGACY KSH R51 2015/10/09
@(#)LEGACY KSH R51 2015/10/24
description:
Check version of legacy shell.
stdin:
@ -475,6 +475,9 @@ stdin:
va[1975973142]=right
va[4123456789]=wrong
echo x7 ${va[#4123456789%2147483647]}
# make sure multiple calculations don't interfere with each other
let '# mca = -4 % -2' ' mcb = -4 % -2'
echo x8 $mca $mcb
expected-stdout:
x1 -1 4294967295
x2 -171510507 4123456789
@ -483,6 +486,7 @@ expected-stdout:
x5 -171510507 4123456789
x6 1975973142 1975973142
x7 right
x8 -4 0
---
name: arith-limit32-1
description:
@ -8534,13 +8538,36 @@ expected-stdout:
0
1
---
name: varexpand-funny-chars
description:
Check some characters
XXX \uEF80 is asymmetric, possibly buggy so we dont check this
stdin:
x=$'<\x00>'; typeset -p x
x=$'<\x01>'; typeset -p x
x=$'<\u0000>'; typeset -p x
x=$'<\u0001>'; typeset -p x
expected-stdout:
typeset x='<'
typeset x=$'<\001>'
typeset x='<'
typeset x=$'<\001>'
---
name: print-funny-chars
description:
Check print builtin's capability to output designated characters
stdin:
print '<\0144\0344\xDB\u00DB\u20AC\uDB\x40>'
print '<\x00>'
print '<\x01>'
print '<\u0000>'
print '<\u0001>'
expected-stdout:
<däÛÃâ¬Ã@>
<>
<>
<>
<>
---
name: print-bksl-c
description:

4
expr.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.78 2015/09/05 19:19:03 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.79 2015/10/24 19:45:23 tg Exp $");
/* the order of these enums is constrained by the order of opinfo[] */
enum token {
@ -920,6 +920,7 @@ ksh_access(const char *fn, int mode)
return (rv);
}
#ifndef MIRBSD_BOOTFLOPPY
/* From: X11/xc/programs/xterm/wcwidth.c,v 1.8 2014/06/24 19:53:53 tg Exp $ */
struct mb_ucsrange {
@ -1199,3 +1200,4 @@ utf_wcwidth(unsigned int wc)
return (2);
return (1);
}
#endif

View File

@ -38,7 +38,7 @@
#endif
#endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.286 2015/10/09 21:36:55 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.287 2015/10/24 19:46:09 tg Exp $");
#if HAVE_KILLPG
/*
@ -431,8 +431,10 @@ c_print(const char **wp)
char ts[4];
ts[utf_wctomb(ts, c - 0x100)] = 0;
for (c = 0; ts[c]; ++c)
c = 0;
do {
Xput(xs, xp, ts[c]);
} while (ts[++c]);
continue;
}
}

7
lex.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.212 2015/10/09 19:29:48 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.213 2015/10/24 19:46:10 tg Exp $");
/*
* states while lexing word
@ -601,10 +601,11 @@ yylex(int cf)
} else {
cz = utf_wctomb(ts, c2 - 0x100);
ts[cz] = 0;
for (cz = 0; ts[cz]; ++cz) {
cz = 0;
do {
*wp++ = QCHAR;
*wp++ = ts[cz];
}
} while (ts[++cz]);
}
}
} else if (!statep->ls_bool) {

11
sh.h
View File

@ -108,6 +108,9 @@
#if HAVE_VALUES_H
#include <values.h>
#endif
#ifdef MIRBSD_BOOTFLOPPY
#include <wchar.h>
#endif
#undef __attribute__
#if HAVE_ATTRIBUTE_BOUNDED
@ -172,9 +175,9 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.749 2015/10/09 21:36:59 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.750 2015/10/24 19:45:23 tg Exp $");
#endif
#define MKSH_VERSION "R51 2015/10/09"
#define MKSH_VERSION "R51 2015/10/24"
/* arithmetic types: C implementation */
#if !HAVE_CAN_INTTYPES
@ -1727,7 +1730,11 @@ int utf_widthadj(const char *, const char **);
size_t utf_mbswidth(const char *) MKSH_A_PURE;
const char *utf_skipcols(const char *, int) MKSH_A_PURE;
size_t utf_ptradj(const char *) MKSH_A_PURE;
#ifdef MIRBSD_BOOTFLOPPY
#define utf_wcwidth(i) wcwidth((wchar_t)(i))
#else
int utf_wcwidth(unsigned int) MKSH_A_PURE;
#endif
int ksh_access(const char *, int);
struct tbl *tempvar(void);
/* funcs.c */