diff --git a/src/GF/Compile/GFCCtoProlog.hs b/src/GF/Compile/GFCCtoProlog.hs index 50cbb3312..4e1ccfba6 100644 --- a/src/GF/Compile/GFCCtoProlog.hs +++ b/src/GF/Compile/GFCCtoProlog.hs @@ -207,7 +207,7 @@ plVar = varPrefix . concatMap changeNonAlphaNum plAtom :: String -> String plAtom "" = "''" plAtom atom@(c:cs) | isAsciiLower c && all isAlphaNumUnderscore cs - || c == '\'' && last cs == '\'' = atom + || c == '\'' && cs /= "" && last cs == '\'' = atom | otherwise = "'" ++ concatMap changeQuote atom ++ "'" where changeQuote '\'' = "\\'" changeQuote c = [c]