[Bug 272915] New: gnuplot: SUSE-specific patch mangles locale
https://bugzilla.novell.com/show_bug.cgi?id=272915 Summary: gnuplot: SUSE-specific patch mangles locale Product: openSUSE 10.3 Version: Alpha 3plus Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: burnus@gmx.de QAContact: qa@suse.de Follow up to bug #266693. Using the vanilla source of gnuplot 4.2, no locale warning is shown for the "wxt" terminal and also doing gnuplot> !locale LANG=de_US.UTF-8 produces a nice en_US.UTF-8 locale. However, after applying SUSE's gnuplot-4.2.0.dif, the locale is mangled: gnuplot> !locale LANG=en which is also the reason for the wxt locale problem. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=272915 ------- Comment #1 from burnus@gmx.de 2007-05-09 13:39 MST ------- More details: + char* lang = getenv ("LANG"); This returns a pointer to the environment variable itself, which is then truncated: + lang[2] = '\0'; This is wrong as $LANG is later needed (e.g. for wxt) and also not recommended use of getenv according the POSIX standard: "The getenv() function shall search the environment of the calling process for the environment variable name if it exists and return a pointer to the value of the environment variable. [...] If the application modifies environ or the pointers to which it points, the behavior of getenv() is undefined. [...] The string pointed to may be overwritten by a subsequent call to getenv(), setenv(), or unsetenv(), but shall not be overwritten by a call to any other function in this volume of IEEE Std 1003.1-2001." The full patch is: +#ifdef __linux__ + if (!getenv("GNUHELP")) { + char* lang = getenv ("LANG"); + if (lang) { + char hfile[64]; + struct stat buf; + + if (strlen(lang) > 2) + lang[2] = '\0'; + strcpy(hfile, "/usr/share/gnuplot/4.0/gnuplot-"); + strcat(hfile, lang); + strcat(hfile, ".gih"); + if (stat(hfile, &buf) == 0) + setenv("GNUHELP", strdup(hfile), 0); + } + } +#endif + Next question is why it hangs with FVWM. (Werner Fink wrote in bug 266693: "Next point is that the wxt window can not be closed by mouse button during a gnuplot session at least within fvwm2"). I wouldn't be surprised if this turns out to be a local problem too. By the way: Any plans to submit the bug fixes in the *.dif files to https://sourceforge.net/projects/gnuplot/ ? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=272915 chrubis@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |werner@novell.com |screening@forge.provo.novell| |.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=272915 ------- Comment #2 from werner@novell.com 2007-05-11 08:24 MST ------- The hang has nothing todo with locale (I use and prefer POSIX) its simple a problem that fvwm is not GNOME. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=272915 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #3 from werner@novell.com 2007-05-11 08:56 MST ------- fixed by using setlocale(LC_MESSAGES, NULL) instead of getenv(LANG). Beside this, the most patches are configuration, some of the are the rest of not accepted changes. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com