Merge pull request #669 from hnyman/git-branch
[project/luci.git] / modules / luci-base / src / template_utils.c
index 80542bd..3979487 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * LuCI Template - Utility functions
  *
- *   Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
+ *   Copyright (C) 2010 Jo-Philipp Wich <jow@openwrt.org>
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -477,18 +477,8 @@ void luastr_translate(struct template_buffer *out, const char *s, unsigned int l
        char *tr;
        int trlen;
 
-       switch (lmo_translate(s, l, &tr, &trlen))
-       {
-               case 0:
-                       luastr_escape(out, tr, trlen, escape_xml);
-                       break;
-
-               case -1:
-                       luastr_escape(out, s, l, escape_xml);
-                       break;
-
-               default:
-                       /* no catalog loaded */
-                       break;
-       }
+       if (!lmo_translate(s, l, &tr, &trlen))
+               luastr_escape(out, tr, trlen, escape_xml);
+       else
+               luastr_escape(out, s, l, escape_xml);
 }