aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/erl_lint.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-04-19 16:10:15 +0200
committerHans Bolinder <[email protected]>2017-04-24 14:51:03 +0200
commitef0dbc4f2a43d629d086c3e2b9a762bbc00d034b (patch)
treede3dd7b8d268f0819453920f8b6e8efb7212477e /lib/stdlib/src/erl_lint.erl
parent739bca3fc267c55d84c8f5c193d16c0b2a7eee13 (diff)
downloadotp-ef0dbc4f2a43d629d086c3e2b9a762bbc00d034b.tar.gz
otp-ef0dbc4f2a43d629d086c3e2b9a762bbc00d034b.tar.bz2
otp-ef0dbc4f2a43d629d086c3e2b9a762bbc00d034b.zip
stdlib: Add Unicode modifier t to control sequences w and W
As of the introduction of Unicode characters in atoms, the control sequences 'w' and 'W' can return non-Latin-1 characters, unless some measure is taken. This commit makes sure that '~w' and '~W' always return Latin-1 characters, or bytes, which can be output to ports or written to raw files. The Unicode translation modifier 't' is needed to return non-Latin-1 characters.
Diffstat (limited to 'lib/stdlib/src/erl_lint.erl')
-rw-r--r--lib/stdlib/src/erl_lint.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index 78b7a0e751..7c40058dd8 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -3883,6 +3883,10 @@ extract_sequence(4, [$t, $p | Fmt], Need) ->
extract_sequence(5, [$p|Fmt], Need);
extract_sequence(4, [$t, $P | Fmt], Need) ->
extract_sequence(5, [$P|Fmt], Need);
+extract_sequence(4, [$t, $w | Fmt], Need) ->
+ extract_sequence(5, [$w|Fmt], Need);
+extract_sequence(4, [$t, $W | Fmt], Need) ->
+ extract_sequence(5, [$W|Fmt], Need);
extract_sequence(4, [$t, C | _Fmt], _Need) ->
{error,"invalid control ~t" ++ [C]};
extract_sequence(4, [$l, $p | Fmt], Need) ->