X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-base%2Fsrc%2Ftemplate_utils.c;h=3979487f1276453ca32d06d26e8eb4de0584114b;hp=80542bd4f331d612c9071dfcbab8a58b14020f8e;hb=dfd082c53bfb607b0c78973095ab49f831b7e1ac;hpb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92 diff --git a/modules/luci-base/src/template_utils.c b/modules/luci-base/src/template_utils.c index 80542bd4f..3979487f1 100644 --- a/modules/luci-base/src/template_utils.c +++ b/modules/luci-base/src/template_utils.c @@ -1,7 +1,7 @@ /* * LuCI Template - Utility functions * - * Copyright (C) 2010 Jo-Philipp Wich + * Copyright (C) 2010 Jo-Philipp Wich * * 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); }