make one of the xkb functions less stupid
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 31 Jan 2013 16:07:45 +0000 (16:07 +0000)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 31 Jan 2013 16:07:45 +0000 (16:07 +0000)
SVN revision: 83526

src/bin/e_xkb.c

index e1984da..74b2426 100644 (file)
@@ -221,8 +221,12 @@ e_xkb_layout_set(const char *name)
 EAPI const char *
 e_xkb_layout_name_reduce(const char *name)
 {
-   if ((name) && (strchr(name, '/'))) name = strchr(name, '/') + 1;
-   return name;
+   const char *s;
+
+   if (!name) return NULL;
+   s = strchr(name, '/');
+   if (s) s++;
+   return s;
 }
 
 EAPI void