チケット #38855

Breakage on Solaris under ISO-8859 locales

登録: 2019-01-10 05:05 最終更新: 2019-01-21 18:19

報告者:
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
(未割り当て)
優先度:
5 - 中
重要度:
5 - 中
解決法:
不正
ファイル:
なし
投票
点数: 0
No votes
0.0% (0/0)
0.0% (0/0)

詳細

Yash 2.48 breaks badly on Solaris when an ISO-8859-* locale is active and any high-byte characters are processed.

Test script:

set -x
sh -xc 'echo "XaYöb"'

case XaYöb in
( X*Y* ) echo ok; exit ;;
( *Y* ) echo yashbug; exit ;;
( * ) echo wrong; exit ;;
esac
echo WRONG2

To trigger the bug, run this on Solaris with something like: LANG=nl_NL.ISO8859-1 yash test.sh

Symptoms:

  • The sh -xc command is traced but otherwise not executed. In general it seems like an external command is silently skipped if any of its arguments contain a high-byte character.
  • The case pattern matches *Y* but not X*Y* as it should, so yashbug is output.

Whether this is a Solaris bug or a yash bug, I couldn't say. However, yash seems to be the only shell exhibiting these symptoms on Solaris.

FYI, Solaris VMs can be downloaded and used free of charge for the purposes of software development and testing. See: https://www.oracle.com/technetwork/server-storage/solaris11/downloads/vm-templates-2245495.html

チケットの履歴 (5 件中 3 件表示)

2019-01-10 05:05 更新者: mcdutchie
  • 新しいチケット "Breakage on Solaris under ISO-8859 locales" が作成されました
2019-01-15 22:31 更新者: magicant
コメント

Reproduced. But yash does not seem to compile correctly on Solaris in the first place.

2019-01-16 00:30 更新者: magicant
コメント

Yash's configuration header defines _XOPEN_SOURCE_EXTENDED to get the declaration of the "enhanced curses" features, but on Solaris this macro hides functions that are only available on XPG5 or later. The macro should not be defined on Solaris.

That said, just removing the macro definition did not fix the encoding issue.

2019-01-20 12:37 更新者: magicant
コメント

It seems the wcsnrtombs function is broken on Solaris. If you comment out the HAVE_WCSNRTOMBS macro definition in config.h, yash no longer prints "yashbug".

2019-01-21 18:19 更新者: magicant
  • 解決法なし から 不正 に更新されました
  • 状況オープン から 完了 に更新されました
コメント

Added a note in the README.

添付ファイルリスト

添付ファイルはありません

編集

ログインしていません。ログインしていない状態では、コメントに記載者の記録が残りません。 » ログインする