summaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/lua.c b/lua.c
index a454e9ec..3731b821 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.185 2010/02/09 11:58:57 roberto Exp roberto $ 2** $Id: lua.c,v 1.186 2010/02/11 17:12:27 roberto Exp roberto $
3** Lua stand-alone interpreter 3** Lua stand-alone interpreter
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -103,11 +103,14 @@ static void laction (int i) {
103 103
104 104
105static void print_usage (const char *badoption) { 105static void print_usage (const char *badoption) {
106 if (badoption[1] == 'e' || badoption[1] == 'l') 106 if (badoption[1] == 'e' || badoption[1] == 'l') {
107 fprintf(stderr, "%s: '%s' needs argument\n", progname, badoption); 107 luai_writestringerror("%s: ", progname);
108 else 108 luai_writestringerror("'%s' needs argument\n", badoption);
109 fprintf(stderr, "%s: unrecognized option '%s'\n", progname, badoption); 109 } else {
110 fprintf(stderr, 110 luai_writestringerror("%s: ", progname);
111 luai_writestringerror("unrecognized option '%s'\n", badoption);
112 }
113 luai_writestringerror(
111 "usage: %s [options] [script [args]]\n" 114 "usage: %s [options] [script [args]]\n"
112 "Available options are:\n" 115 "Available options are:\n"
113 " -e stat execute string " LUA_QL("stat") "\n" 116 " -e stat execute string " LUA_QL("stat") "\n"
@@ -122,8 +125,8 @@ static void print_usage (const char *badoption) {
122 125
123 126
124static void l_message (const char *pname, const char *msg) { 127static void l_message (const char *pname, const char *msg) {
125 if (pname) fprintf(stderr, "%s: ", pname); 128 if (pname) luai_writestringerror("%s: ", pname);
126 fprintf(stderr, "%s\n", msg); 129 luai_writestringerror("%s\n", msg);
127} 130}
128 131
129 132