=================================================================== RCS file: /cvs/mandoc/Attic/apropos_db.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -p -r1.3 -r1.4 --- mandoc/Attic/apropos_db.c 2011/11/13 11:10:27 1.3 +++ mandoc/Attic/apropos_db.c 2011/11/14 10:07:06 1.4 @@ -1,4 +1,4 @@ -/* $Id: apropos_db.c,v 1.3 2011/11/13 11:10:27 schwarze Exp $ */ +/* $Id: apropos_db.c,v 1.4 2011/11/14 10:07:06 kristaps Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2011 Ingo Schwarze @@ -454,23 +454,23 @@ out: } struct expr * -exprcomp(int argc, char *argv[]) +exprcomp(char *buf) { struct expr *p; struct expr e; char *key; int i, icase; - if (0 >= argc) + if ('\0' == *buf) return(NULL); /* * Choose regex or substring match. */ - if (NULL == (e.v = strpbrk(*argv, "=~"))) { + if (NULL == (e.v = strpbrk(buf, "=~"))) { e.regex = 0; - e.v = *argv; + e.v = buf; } else { e.regex = '~' == *e.v; *e.v++ = '\0'; @@ -482,15 +482,15 @@ exprcomp(int argc, char *argv[]) icase = 0; e.mask = 0; - if (*argv < e.v) { - while (NULL != (key = strsep(argv, ","))) { + if (buf < e.v) { + while (NULL != (key = strsep(&buf, ","))) { if ('i' == key[0] && '\0' == key[1]) { icase = REG_ICASE; continue; } i = 0; while (types[i].mask && - strcmp(types[i].name, key)) + strcmp(types[i].name, key)) i++; e.mask |= types[i].mask; }