Changeset 1948

Show
Ignore:
Timestamp:
02/26/09 16:31:07 (3 years ago)
Author:
mwhitworth
Message:

Alphabetically sort tab results.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/tags/0.2b/user/sdk/console/tab.c

    r1668 r1948  
    2020{ 
    2121        context->tabOutput = output; 
     22} 
     23 
     24int stringCompare(const void* p1, const void* p2) 
     25{ 
     26        return strcasecmp(*(char**)p1, *(char**)p2); 
    2227} 
    2328 
     
    5459                 * the console. */ 
    5560                fputc('\n', stdout); 
     61 
     62                /* Sort into alphabetical order. */ 
     63                qsort(results, total, sizeof(char*), stringCompare); 
    5664 
    5765                for (j=0; j<total; j++)