From 9f5547327e3710303d3cb40b4bc55e74653a70ee Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 26 Nov 2013 23:18:12 -0800 Subject: [PATCH] Fix for compile error identified in https://github.com/fish-shell/fish-shell/issues/1142 --- common.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common.cpp b/common.cpp index b7cdedc87..9608e31eb 100644 --- a/common.cpp +++ b/common.cpp @@ -1197,7 +1197,12 @@ static size_t read_unquoted_escape(const wchar_t *input, wcstring *result, bool case L'U': { chars=8; - max_val = mini(WCHAR_MAX, 0x10FFFF); // Largest Unicode code point - see #1107 + max_val = WCHAR_MAX; + + // Don't exceed the largest Unicode code point - see #1107 + if (0x10FFFF < max_val) + max_val = (wchar_t)0x10FFFF; + break; }