summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-11-05 16:09:36 +0000
committerDaniel Kolesa <d.kolesa@samsung.com>2014-11-05 16:09:36 +0000
commitf0f9edd0bd1a35b52e1e0b145dd08f6183d64db3 (patch)
tree18fb47607af542f94421bbab5b8c067baec0286f
parentd23b9342d5446b688db2187871817d9f0338aefa (diff)
elua: remove the : prefix for running apps
Instead, check if there is a file specified by the argument to elua and if there is, execute it, otherwise treat it as app name. The reason this is done is that the colon triggered ugly stuff in certain environments, such as our MinGW crossbuild Jenkins slave. @fix
-rw-r--r--src/Makefile_Elua_Helper.am4
-rw-r--r--src/bin/elua/main.c17
2 files changed, 13 insertions, 8 deletions
diff --git a/src/Makefile_Elua_Helper.am b/src/Makefile_Elua_Helper.am
index c92f2dfa5f..e8f5334c82 100644
--- a/src/Makefile_Elua_Helper.am
+++ b/src/Makefile_Elua_Helper.am
@@ -1,9 +1,9 @@
1if HAVE_ELUA_BIN 1if HAVE_ELUA_BIN
2ELUA_GEN = @elua_bin@ :lualian 2ELUA_GEN = @elua_bin@ lualian
3_ELUA_GEN_DEP = @elua_bin@ 3_ELUA_GEN_DEP = @elua_bin@
4else 4else
5ELUA_GEN = ELUA_EOLIAN_LIBRARY_PATH=$(top_builddir)/src/lib/eolian/.libs \ 5ELUA_GEN = ELUA_EOLIAN_LIBRARY_PATH=$(top_builddir)/src/lib/eolian/.libs \
6 EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/elua/elua${EXEEXT} :lualian 6 EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/elua/elua${EXEEXT} lualian
7_ELUA_GEN_DEP = bin/elua/elua${EXEEXT} bin/elua/modules/lualian.lua 7_ELUA_GEN_DEP = bin/elua/elua${EXEEXT} bin/elua/modules/lualian.lua
8endif 8endif
9 9
diff --git a/src/bin/elua/main.c b/src/bin/elua/main.c
index 2ed8893629..b1703e95bc 100644
--- a/src/bin/elua/main.c
+++ b/src/bin/elua/main.c
@@ -93,10 +93,7 @@ elua_getargs(lua_State *L, int argc, char **argv, int n)
93 lua_createtable(L, narg, n + 1); 93 lua_createtable(L, narg, n + 1);
94 for (i = 0; i < argc; ++i) 94 for (i = 0; i < argc; ++i)
95 { 95 {
96 if (!(i - n) && argv[i][0] == ':') 96 lua_pushstring(L, argv[i]);
97 lua_pushstring(L, &argv[i][1]);
98 else
99 lua_pushstring(L, argv[i]);
100 lua_rawseti(L, -2, i - n); 97 lua_rawseti(L, -2, i - n);
101 } 98 }
102 return narg; 99 return narg;
@@ -233,9 +230,17 @@ elua_doscript(lua_State *L, int argc, char **argv, int n, int *quit)
233 { 230 {
234 fname = NULL; 231 fname = NULL;
235 } 232 }
236 if (fname && fname[0] == ':') 233 if (fname)
237 { 234 {
238 status = !elua_loadapp(L, fname + 1); 235 /* check if there is a file of that name */
236 FILE *f = fopen(fname, "r");
237 if (f)
238 {
239 fclose(f);
240 status = elua_loadfile(L, fname);
241 }
242 else
243 status = !elua_loadapp(L, fname);
239 } 244 }
240 else 245 else
241 { 246 {