diff options
author | jilles <jilles@FreeBSD.org> | 2011-05-08 17:40:10 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2011-05-08 17:40:10 +0000 |
commit | c9be2081e05e10ddab3dcb7fe31efcc981524e18 (patch) | |
tree | e90b9f059591317bfa02d51bd83a0cf89ad9f520 /bin/sh/main.c | |
parent | bf0e27838c7f0e2558fb05339e6f8b74848281c9 (diff) | |
download | FreeBSD-src-c9be2081e05e10ddab3dcb7fe31efcc981524e18.zip FreeBSD-src-c9be2081e05e10ddab3dcb7fe31efcc981524e18.tar.gz |
sh: Add \u/\U support (in $'...') for UTF-8.
Because we have no iconv in base, support for other charsets is not
possible.
Note that \u/\U are processed using the locale that was active when the
shell started. This is necessary to avoid behaviour that depends on the
parse/execute split (for example when placing braces around an entire
script). Therefore, UTF-8 encoding is implemented manually.
Diffstat (limited to 'bin/sh/main.c')
-rw-r--r-- | bin/sh/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/sh/main.c b/bin/sh/main.c index d3250eb..d962920 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); int rootpid; int rootshell; struct jmploc main_handler; -int localeisutf8; +int localeisutf8, initial_localeisutf8; static void read_profile(const char *); static char *find_dot_file(char *); @@ -97,7 +97,7 @@ main(int argc, char *argv[]) char *shinit; (void) setlocale(LC_ALL, ""); - updatecharset(); + initcharset(); state = 0; if (setjmp(main_handler.loc)) { switch (exception) { |