[elinks-users] garbled error messages

Miciah Dashiel Butler Masters miciah at myrealbox.com
Fri May 6 10:03:26 PDT 2005


On Fri, May 06, 2005 at 01:50:24PM +0100, Jon Shapcott wrote:
> [...]
> > Jon Shapcott <eden at xibalba.demon.co.uk> wrote Fri, May 06, 2005:
> > > During my current hacking, I've had some trouble with the alert_lua_error
> > > function. Instead of displaying the desired message, it prints some garbled
> > > text instead. I've checked that I'm not feeding it broken messages by
> > > printing them to stderr as well, and checking that output. Is this a known
> > > problem? If so, is there any known way of kicking it into proper behaviour?
> [...]
> Sorry for the second response. I'm hacking elinks-0.10.5. I've tracked the
> text for alert_lua_error through open_box and msg_box in src/bfu/msg_box.c,
> and add_dlg_text in src/bfu/text.c. It doesn't get garbled in any of those
> places, so I must be stamped on somewhere between there and being displayed.
> As I was doing this, every now and then the leading part of the string would
> be be mangled,, but the trailing part of the text would be shown normally.

Here is my guess: Something changes (maybe frees) the string after
passing it to alert_lua_error, which never does a strdup or similar.

RCS file: /home/cvs/elinks/elinks/src/scripting/lua/core.c,v
retrieving revision 1.198
diff -u -u -r1.198 core.c
--- core.c      29 Apr 2005 07:40:52 -0000      1.198
+++ core.c      6 May 2005 17:01:03 -0000
@@ -717,9 +717,9 @@
 alert_lua_error(unsigned char *msg)
 {
        if (errterm) {
-               info_box(errterm, MSGBOX_NO_TEXT_INTL,
+               info_box(errterm, MSGBOX_NO_TEXT_INTL, MSGBOX_FREE_TEXT,
                        N_("Lua Error"), ALIGN_LEFT,
-                       msg);
+                       stracpy(msg));
                return;
        }

Does the above untested change help?

> [...]
> It looks like this sort of work is best done on the unstable version. Is the
> unstable version updated daily on the download page?

Yes, when nothing is broken. I just downloaded it (wasty wasty)
and it seems not to be broken.

>                                                      Is this discussion best
> moved to elinks-dev rather than elinks-user?

Probably, but I don't expect that anybody cares.

--
Miciah Masters <miciah at myrealbox.com> / <mdm0304 at mail.ecu.edu>



More information about the elinks-users mailing list