Commit 5df92f67 authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

hp2ps: fix invalid PostScript for names with parentheses

The names in the .hp files may contain un-matched opening parentheses,
so escape them.

GHC Trac: #9517

Reviewers: bgamari, austin

Reviewed By: bgamari, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2398

GHC Trac Issues: #9517
parent 89a8be71
......@@ -44,7 +44,8 @@ escape(char *result, const char *name)
{
while (*name != '\0')
{
if (*name == '\\')
// escape parentheses too, because "name" could contain un-matched ones
if (*name == '\\' || *name == '(' || *name == ')')
{
*result++ = '\\';
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment