diff --git a/pkgs/os-specific/linux/syslinux/default.nix b/pkgs/os-specific/linux/syslinux/default.nix index 93e5d591a9d9..3c01516b0815 100644 --- a/pkgs/os-specific/linux/syslinux/default.nix +++ b/pkgs/os-specific/linux/syslinux/default.nix @@ -8,7 +8,8 @@ stdenv.mkDerivation rec { sha256 = "03l5iifwlg1wyb4yh98i0b7pd4j55a1c9y74q1frs47a5dnrilr6"; }; - patches = [ ./perl-deps.patch ]; + # gcc5-fix should be in 6.04+, so remove if it fails to apply. + patches = [ ./perl-deps.patch ./gcc5-fix.patch ]; buildInputs = [ nasm perl libuuid ]; diff --git a/pkgs/os-specific/linux/syslinux/gcc5-fix.patch b/pkgs/os-specific/linux/syslinux/gcc5-fix.patch new file mode 100644 index 000000000000..dc44b1880583 --- /dev/null +++ b/pkgs/os-specific/linux/syslinux/gcc5-fix.patch @@ -0,0 +1,26 @@ +diff --git a/com32/include/menu.h b/com32/include/menu.h +index bc0182f..b0251e4 100644 +--- a/com32/include/menu.h ++++ b/com32/include/menu.h +@@ -195,7 +195,7 @@ void local_cursor_enable(bool); + + static inline int my_isspace(char c) + { +- return (unsigned char)c <= ' '; ++ return (unsigned char)c <= ' ' || (unsigned char)c == '\x7f'; + } + + int my_isxdigit(char c); +diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c +index b7814be..a433fad 100644 +--- a/com32/menu/readconfig.c ++++ b/com32/menu/readconfig.c +@@ -299,7 +299,7 @@ static char *copy_sysappend_string(char *dst, const char *src) + char c; + + while ((c = *src++)) { +- if (c <= ' ' && c == '\x7f') { ++ if (my_isspace(c)) { + if (!was_space) + *dst++ = '_'; + was_space = true;