[Fencommits] fenserve: fix

Benja Fallenstein benja.fallenstein at gmail.com
Fri May 25 19:16:09 EEST 2007


Fri May 25 19:15:59 EEST 2007  Benja Fallenstein <benja.fallenstein at gmail.com>
  * fix
diff -rN -u old-fenserve/fendata/Main.hs new-fenserve/fendata/Main.hs
--- old-fenserve/fendata/Main.hs	2007-05-25 19:16:09.000000000 +0300
+++ new-fenserve/fendata/Main.hs	2007-05-25 19:16:09.000000000 +0300
@@ -265,7 +265,7 @@
                , h ["potion"] GET $ ok $ \() -> run $ 
                    \req s -> let ?root = "" in potionGet (read $ fromJust $ lookM req "exp") (readArgs req) (lookM req "name") s
                , h (Prefix ["potion"]) GET $ ok $ \(fun:args) -> run $ 
-                   \req s -> let ?root = concat (take (1 + length args) $ repeat "../") in potionGet (Call fun (map (Just . Str) $ readArgs req)) (readArgs req) (lookM req "name") s
+                   \req s -> let ?root = concat (take (1 + length args) $ repeat "../") in potionGet (Call fun (map (Just . Str) $ args)) args (lookM req "name") s
                , h ["edit"] GET $ ok $ \() -> run $ \req ->
                      edit (read $ fromJust $ lookM req "exp",
                            read $ fromJust $ lookM req "old",
diff -rN -u old-fenserve/fendata/Potions.hs new-fenserve/fendata/Potions.hs
--- old-fenserve/fendata/Potions.hs	2007-05-25 19:16:09.000000000 +0300
+++ new-fenserve/fendata/Potions.hs	2007-05-25 19:16:09.000000000 +0300
@@ -65,6 +65,7 @@
     f []     [x]    _      n = editLink cx exp ty x
     f (t:ts) (x:xs) (y:ys) n = 
         editLink cx exp ty x +++ renderMaybeExp' y (cx' n) t +++ f ts xs ys (n+1)
+    f ts xs [] n = f ts xs [Just $ Str "0"] n
 renderExp e0@(Field cat field exp) cx ty = editLink cx e0 ty ("the " +++ field +++ " of ") +++ renderMaybeExp' exp (\e -> cx $ Field cat field $ Just e) (catType cat) where
 renderExp e0@(AllItems cat) cx ty = editLink cx e0 ty ("all the "++cat++"s in the system")
 renderExp exp@(Var i) cx ty = editLink cx exp ty (renderVar i)




More information about the Fencommits mailing list