uniq.c (294B)
1 /* Copyright ©2008-2010 Kris Maglione <maglione.k at Gmail> 2 * See LICENSE file for license details. 3 */ 4 #include <string.h> 5 #include "util.h" 6 7 void 8 uniq(char **toks) { 9 char **p, **q; 10 11 q = toks; 12 if(*q == nil) 13 return; 14 for(p=q+1; *p; p++) 15 if(strcmp(*q, *p)) 16 *++q = *p; 17 *++q = nil; 18 }