Re: mcedit issues

Andrew V. Samoilov wrote:
Hello, Rolland,

your last "simplification" remove charset conversion.

Also some people collect all of used glib stuff in our glibcompat.c
to eliminate libglib dependancy, and so you enforce them to import g_string_*()

The purpose of glibcompat.c is to provide the functions that are in glib-2, but not in glib-1.2. It is not used as an abstraction layer aroung the glib functions.

--- edit/editcmd.c.orig	Thu Nov  4 20:12:16 2004
+++ edit/editcmd.c	Thu Nov  4 20:19:09 2004
@@ -1181,15 +1181,15 @@ edit_replace_prompt (WEdit * edit, char 0, 0, 0, 0, 0},
- GString *label_text = g_string_new (_(" Replace with: "));
+    char *msg = _(" Replace with: ");
msg must be a const char *. If ENABLE_NLS is not #defined, the following line is executed:
#define _(str) (str)
So you assign a const char * to a char * variable here.

     if (*replace_text) {
-        g_string_append (label_text, replace_text);
-        convert_to_display (label_text->str + label_text->len);
Yes, I see the mistake here. label_text->len should be replaced by the label_text->len from before the g_string_append() call.
+	size_t msg_len = strlen (msg);
+	msg = catstrs (msg, replace_text, (char *) NULL);
+	convert_to_display (msg + msg_len);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]