Ticket #2652: rubbish

File rubbish, 1.2 KB (added by jsnx, 7 years ago)

this is the diff mentioned in comment 3 (turns out the diff is not extractable in this version of trac)

Line 
1 --- 0/compiler/ghci/InteractiveUI.hs    2008-06-16 10:27:16.000000000
2 -0700
3 +++ 1/compiler/ghci/InteractiveUI.hs    2008-10-28 02:57:03.000000000
4 -0700
5 @@ -1447,11 +1447,19 @@
6 setPrompt value = do
7   st <- getGHCiState
8   if null value
9 -      then io $ hPutStrLn stderr $ "syntax: :set prompt <prompt>,
10 currently \"" ++ prompt st ++ "\""
11 -      else setGHCiState st{ prompt = remQuotes value }
12 +      then io $ hPutStrLn stderr $
13 +        "syntax: :set prompt <prompt>, currently \"" ++ prompt st ++ "\""
14 +      else setGHCiState st{ prompt = read . handleQuotes $ value }
15   where
16 -     remQuotes ('\"':xs) | not (null xs) && last xs == '\"' = init xs
17 -     remQuotes x = x
18 +     -- the prompt can be input with quote marks and string escaping, or
19 +     -- with plain character escaping.
20 +     handleQuotes s | length s > 2 && last s == '"' && head s == '"' = s
21 +                    | otherwise = wrap . escapeQuotes $ s
22 +     wrap = ("\"" ++) . (++ "\"")
23 +     escapeQuotes ('\':'"':r) = '\' : '"' : escapeQuotes r
24 +     escapeQuotes ('"':r) = '\' : '"' : escapeQuotes r
25 +     escapeQuotes (c:r) = c : escapeQuotes r
26 +     escapeQuotes [ ] = [ ]
27
28 setOptions wds =
29    do -- first, deal with the GHCi opts (+s, +t, etc.)
30