mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
- Fixed 2 syntax errors in plmenu.zh_TW.Big5 (Mike FABIAN <mfabian@suse.de>)
- Some .po file fixes (Mike FABIAN <mfabian@suse.de>) - Fixed the problem with the root menu code changing the locale setting as a side effect of loading a localized menu - Fixed e memory leak in the code that reads a localized root menu
This commit is contained in:
@@ -362,8 +362,7 @@ legalPanelCommand(WMenu *menu, WMenuEntry *entry)
|
||||
static char*
|
||||
getLocalizedMenuFile(char *menu)
|
||||
{
|
||||
char *buffer;
|
||||
char *ptr;
|
||||
char *buffer, *ptr, *locale;
|
||||
int len;
|
||||
|
||||
if (!Locale)
|
||||
@@ -377,8 +376,12 @@ getLocalizedMenuFile(char *menu)
|
||||
if (access(buffer, F_OK)==0) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/* position of locale in our buffer */
|
||||
locale = buffer + strlen(menu) + 1;
|
||||
|
||||
/* check if it is in the form aa_bb.encoding and check for aa_bb */
|
||||
ptr = strchr(Locale, '.');
|
||||
ptr = strchr(locale, '.');
|
||||
if (ptr) {
|
||||
*ptr = 0;
|
||||
if (access(buffer, F_OK)==0) {
|
||||
@@ -386,7 +389,7 @@ getLocalizedMenuFile(char *menu)
|
||||
}
|
||||
}
|
||||
/* now check for aa */
|
||||
ptr = strchr(buffer, '_');
|
||||
ptr = strchr(locale, '_');
|
||||
if (ptr) {
|
||||
*ptr = 0;
|
||||
if (access(buffer, F_OK)==0) {
|
||||
@@ -394,6 +397,8 @@ getLocalizedMenuFile(char *menu)
|
||||
}
|
||||
}
|
||||
|
||||
wfree(buffer);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user