* main.c: when doing the conversion from strcasecmp (wrongly used)

to strcasestr, it was used in a wrong way (reverse logic error in
  checking its return value), turning to mis-detection of UTF-8 locale.
* sh.h, check.t: bump version
* copyright: bump year
This commit is contained in:
tg 2007-01-03 22:43:48 +00:00
parent 127760cfa5
commit 17a3fffc26
4 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.76 2006/12/11 16:09:49 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.77 2007/01/03 22:43:47 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -7,7 +7,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh # http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout: expected-stdout:
@(#)MIRBSD KSH R29 2006/12/07 @(#)MIRBSD KSH R29 2007/01/03
description: description:
Check version of shell. Check version of shell.
category: pdksh category: pdksh

View File

@ -1,8 +1,8 @@
$MirOS: src/bin/mksh/copyright,v 1.17 2006/12/11 21:24:12 tg Exp $ $MirOS: src/bin/mksh/copyright,v 1.18 2007/01/03 22:43:47 tg Exp $
The MirBSD Korn Shell (mksh) is The MirBSD Korn Shell (mksh) is
Copyright (c) 2002, 2003, 2004, 2005, 2006 Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007
Thorsten Glaser <tg@mirbsd.de> Thorsten Glaser <tg@mirbsd.de>
Provided that these terms and disclaimer and all copyright notices Provided that these terms and disclaimer and all copyright notices

8
main.c
View File

@ -13,7 +13,7 @@
#include <locale.h> #include <locale.h>
#endif #endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.62 2006/11/16 13:35:07 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/main.c,v 1.63 2007/01/03 22:43:47 tg Exp $");
extern char **environ; extern char **environ;
@ -284,11 +284,11 @@ main(int argc, char *argv[])
if (!Flag(FUTFHACK)) { if (!Flag(FUTFHACK)) {
cc = setlocale(LC_CTYPE, ""); cc = setlocale(LC_CTYPE, "");
#if HAVE_LANGINFO_CODESET #if HAVE_LANGINFO_CODESET
if (strcasestr(cc, "UTF-8") && strcasestr(cc, "utf8")) if (!strcasestr(cc, "UTF-8") && !strcasestr(cc, "utf8"))
cc = nl_langinfo(CODESET); cc = nl_langinfo(CODESET);
#endif #endif
Flag(FUTFHACK) = !(strcasestr(cc, "UTF-8") && Flag(FUTFHACK) = strcasestr(cc, "UTF-8") ||
strcasestr(cc, "utf8")); strcasestr(cc, "utf8");
} }
#endif #endif
x_init(); x_init();

4
sh.h
View File

@ -8,8 +8,8 @@
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.88 2006/12/11 16:09:49 tg Exp $" #define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.89 2007/01/03 22:43:48 tg Exp $"
#define MKSH_VERSION "R29 2006/12/07" #define MKSH_VERSION "R29 2007/01/03"
#if HAVE_SYS_PARAM_H #if HAVE_SYS_PARAM_H
#include <sys/param.h> #include <sys/param.h>