Changeset 4790 for src/Pugs/Prim/Eval.hs

Show
Ignore:
Timestamp:
06/18/05 13:33:34 (4 years ago)
Author:
iblech
svk:copy_cache_prev:
6529
Message:

Pugs.Prim.Eval -- Made putter+'s (first part of a) %*INC patch safe.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Prim/Eval.hs

    r4775 r4790  
    4444            then requireInc ps file msg 
    4545            else do 
    46 {- 
    47                 -- XXX security issue?  only if you _can_ create a filename, 
    48                 -- but _cant_ control its contents.  Yes? 
    49                 opEval style "<internal>" ("%*INC{q{" 
    50                                            ++ (decodeUTF8 file) 
    51                                            ++ "}} = q{" 
    52                                            ++ (decodeUTF8 pathName) ++ "};") 
    53 -} 
     46                -- %*INC{file} = pathname 
     47                evalExp $ 
     48                    Syn "=" [ Syn "{}" [ Var "%*INC", Val . VStr $ decodeUTF8 file ] 
     49                            , Val . VStr $ decodeUTF8 pathName 
     50                            ] 
    5451                str <- liftIO $ readFile pathName 
    5552                opEval style pathName (decodeUTF8 str)