Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwlive.git;a=commitdiff;h=f164f767174df90244929107054e09731079e36f

commit f164f767174df90244929107054e09731079e36f
Author: James Buren <[email protected]>
Date:   Sat Mar 2 03:35:09 2013 -0600

also sort the layouts list

diff --git a/new/fwsetup/layout.c b/new/fwsetup/layout.c
index 4de4775..f2ee9e4 100644
--- a/new/fwsetup/layout.c
+++ b/new/fwsetup/layout.c
@@ -38,6 +38,14 @@ static inline void put_token(char *in,char **out)
*out = (strcmp(in,"-") == 0) ? 0 : strdup(in);
}

+static int sort_compare(const void *A,const void *B)
+{
+  struct layout *a = *(struct layout **) A;
+  struct layout *b = *(struct layout **) B;
+
+  return strcmp(a->kbdlayout,b->kbdlayout);
+}
+
static bool layout_setup(void)
{
FILE *file = 0;
@@ -91,6 +99,8 @@ static bool layout_setup(void)

layouts = realloc(layouts,sizeof(struct layout *) * (i+1));

+  qsort(layouts,i,sizeof(struct layout *),sort_compare);
+
return true;
}
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to