From c3c46119d7e17e5afff10254f7928c5dcf2039c8b3067c19102562eec8323125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Sat, 12 Jan 2013 12:44:43 +0000 Subject: [PATCH] Accepting request 147916 from home:dstoecker Reintroduce UTF-8 fix. OBS-URL: https://build.opensuse.org/request/show/147916 OBS-URL: https://build.opensuse.org/package/show/editors/nedit?expand=0&rev=8 --- nedit-5.5CVS-utf8.patch | 57 +++++++++++++++++++++++++++++++++++++++++ nedit.changes | 5 ++++ nedit.spec | 2 ++ 3 files changed, 64 insertions(+) create mode 100644 nedit-5.5CVS-utf8.patch diff --git a/nedit-5.5CVS-utf8.patch b/nedit-5.5CVS-utf8.patch new file mode 100644 index 0000000..44dae5c --- /dev/null +++ b/nedit-5.5CVS-utf8.patch @@ -0,0 +1,57 @@ +Index: source/nedit.c +=================================================================== +RCS file: /cvsroot/nedit/nedit/source/nedit.c,v +retrieving revision 1.101 +diff -u -r1.101 nedit.c +--- source/nedit.c 25 Oct 2012 14:10:25 -0000 1.101 ++++ source/nedit.c 10 Jan 2013 11:55:32 -0000 +@@ -96,6 +96,7 @@ + static void maskArgvKeywords(int argc, char **argv, const char **maskArgs); + static void unmaskArgvKeywords(int argc, char **argv, const char **maskArgs); + static void fixupBrokenXKeysymDB(void); ++static void changeLocaleIfUTF8(void); + static void patchResourcesForVisual(void); + static void patchResourcesForKDEbug(void); + static void patchLocaleForMotif(void); +@@ -425,6 +426,8 @@ + /* Save the command which was used to invoke nedit for restart command */ + ArgV0 = argv[0]; + ++ changeLocaleIfUTF8(); ++ + /* Set locale for C library, X, and Motif input functions. + Reverts to "C" if requested locale not available. */ + XtSetLanguageProc(NULL, neditLanguageProc, NULL); +@@ -1133,6 +1136,32 @@ + return setlocale(LC_ALL, NULL); /* re-query in case overwritten */ + } + ++static void changeLocaleIfUTF8(void) ++{ ++ char *locale; ++ ++ locale = getenv("LANG"); ++ if (!locale) { ++ locale = setlocale(LC_ALL, NULL); ++ } ++ ++ if (locale) { ++ char *ptr; ++ ++ ptr = strstr(locale, ".UTF-8"); ++ if (ptr) { ++ fprintf(stderr, "nedit: the current locale is utf8 (%s)\n", locale); ++ ++ ptr[0] = '\0'; ++ ++ setenv("LC_ALL", locale, 1); ++ locale = setlocale(LC_ALL, locale); ++ ++ fprintf(stderr, "nedit: changed locale to non-utf8 (%s)\n", locale); ++ } ++ } ++} ++ + static int sortAlphabetical(const void* k1, const void* k2) + { + const char* key1 = *(const char**)k1; diff --git a/nedit.changes b/nedit.changes index 45533b6..e7ace73 100644 --- a/nedit.changes +++ b/nedit.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 10 12:05:37 UTC 2013 - opensuse@dstoecker.de + +- reintroduce UTF-8 patch which changes default locale to non-UTF-8 (setting LANG=en_US.utf-8 in commandline still works) + ------------------------------------------------------------------- Fri Oct 26 19:30:58 UTC 2012 - opensuse@dstoecker.de diff --git a/nedit.spec b/nedit.spec index 586ffe4..9ba7714 100644 --- a/nedit.spec +++ b/nedit.spec @@ -18,6 +18,7 @@ Patch1: %{name}-5.5CVS-makefiles.patch Patch2: %{name}-5.5CVS-security.patch Patch3: %{name}-5.5CVS-nc-manfix.patch Patch4: %{name}-5.5-visfix.patch +Patch5: %{name}-5.5CVS-utf8.patch %description NEdit is a GUI style plain text editor for workstations with the X Window System @@ -31,6 +32,7 @@ and a lot other nice features (and extensions for programmers). %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p0 %build #find -name .cvsignore |xargs rm