[iok] Resolves: rh#734372 - too many xkb-(null) in the list

pnemade pnemade at fedoraproject.org
Wed Aug 31 09:02:38 UTC 2011


commit 701d258dd07797b9ab62b1a0b6e77d30bd7ca536
Author: Parag Nemade <pnemade at redhat.com>
Date:   Wed Aug 31 14:32:10 2011 +0530

    Resolves: rh#734372 - too many xkb-(null) in the list

 bug734372-fix_xkb_parser.patch |   71 ++++++++++++++++++++++++++++++++++++++++
 iok.spec                       |    8 +++-
 2 files changed, 77 insertions(+), 2 deletions(-)
---
diff --git a/bug734372-fix_xkb_parser.patch b/bug734372-fix_xkb_parser.patch
new file mode 100644
index 0000000..ac8ad25
--- /dev/null
+++ b/bug734372-fix_xkb_parser.patch
@@ -0,0 +1,71 @@
+--- src/interface.c.old	2011-03-22 14:18:20.959966777 +0530
++++ src/interface.c	2011-08-31 11:54:02.606454888 +0530
+@@ -1168,11 +1168,22 @@
+             }
+             else
+             {
+-                itoken = strtok(iline, " \t");
+-                itoken = strtok(NULL, "=\" ");
+-                itoken = strtok(NULL, " ");
+-                itoken = strtok(NULL, "\";");
++                char *nntoken;
++                size_t nn=0,nn_cnt=0;
++                itoken=(char *)malloc(65*sizeof(char));
++                memset(itoken,'\0',65);
+ 
++                nn=strlen(iline);
++                while (nn_cnt < nn)
++                {
++                    if (iline[nn_cnt] == '\"')
++                    {
++                        strncpy(itoken,iline+nn_cnt+1,nn-nn_cnt-4);
++                        break;
++                    }
++                    else
++                        nn_cnt++;
++                }
+             }
+ 
+             //Start actual parsing of map
+@@ -1287,6 +1298,10 @@
+     }
+ 
+     mapcnt=xmapcnt*2;
++    gtk_toggle_button_set_active((GtkToggleButton *)l_shift_btn,FALSE);
++    gtk_toggle_button_set_active((GtkToggleButton *)r_shift_btn,FALSE);
++    gtk_toggle_button_set_active((GtkToggleButton *)caps_btn,FALSE);
++
+ }
+ 
+ char* get_iso_code(char *lname)
+@@ -1706,13 +1721,24 @@
+             }
+             if (strcmp(iline,"\tname[Group1]=\"India\";\n")!=0)
+             {
+-                char *itoken;
+-                itoken = strtok(iline, " \t");
+-                itoken = strtok(NULL, "=\" ");
+-                itoken = strtok(NULL, " ");
+-                itoken = strtok(NULL, "\";");
++                char *itoken,*nntoken;
++                size_t nn=0,nn_cnt=0;
++                itoken=(char *)malloc(65*sizeof(char));
++                memset(itoken,'\0',65);
++
++                nn=strlen(iline);
++                while (nn_cnt < nn)
++                {
++                    if (iline[nn_cnt] == '\"')
++                    {
++                        strncpy(itoken,iline+nn_cnt+1,nn-nn_cnt-4);
++                        break;
++                    }
++                    else
++                        nn_cnt++;
++                }
+                 sprintf(xkfile,"xkb-%s", itoken);
+-                if (strstr(xkfile,"Typewriter")==NULL && strstr(xkfile, "Urdu")==NULL)
++                if (strstr(xkfile,"typewriter")==NULL && strstr(xkfile, "Urdu")==NULL && strstr(xkfile, "English")==NULL)
+                 {
+                     gtk_combo_box_append_text ((GtkComboBox *)combo_mim, xkfile);
+                     maplist[mimcnt]= (char *) malloc(strlen(xkfile)+1);
diff --git a/iok.spec b/iok.spec
index 54f75ac..0369f78 100644
--- a/iok.spec
+++ b/iok.spec
@@ -1,12 +1,13 @@
 Name:           iok
 Version:        1.3.12
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Indic Onscreen Virtual Keyboard
 Group:          Applications/System
 License:        GPLv2+
 URL:            http://iok.sourceforge.net
 Source0:        https://fedorahosted.org/releases/i/o/iok/%{name}-%{version}.tar.gz
 Patch0:         iok-1.3.12-fix-non-standard-keymap-path.patch
+Patch1:         bug734372-fix_xkb_parser.patch
 BuildRequires:  desktop-file-utils libXtst-devel
 BuildRequires:  gtk2-devel gettext libxml2-devel
 BuildRequires:  intltool unique-devel
@@ -20,6 +21,7 @@ can even try to parse non-inscript keymaps and show them in iok.
 %prep
 %setup -q
 %patch0 -p0
+%patch1 -p0
 
 %build
 %configure
@@ -37,7 +39,6 @@ desktop-file-install --vendor fedora \
 %find_lang %{name}
 
 %files -f %{name}.lang
-%defattr(-,root,root,-)
 %doc COPYING AUTHORS ChangeLog README
 %{_bindir}/iok
 %{_datadir}/applications/fedora-iok.desktop
@@ -46,6 +47,9 @@ desktop-file-install --vendor fedora \
 
 
 %changelog
+* Wed Aug 31 2011 Parag Nemade <panemade AT gmail DOT com>- 1.3.12-4
+- Resolves: rh#734372 - too many xkb-(null) in the list
+
 * Tue Mar 22 2011 Parag Nemade <panemade AT gmail DOT com>- 1.3.12-3
 - Resolves: rh#684652 - iok looks for ~/.m17n not ~/.m17n.d 
 


More information about the scm-commits mailing list