-/* $OpenBSD: makemap.c,v 1.54 2015/10/12 07:58:19 deraadt Exp $ */
+/* $OpenBSD: makemap.c,v 1.55 2015/10/17 19:44:07 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
{
struct expandnode xn;
char *subrcpt;
- char *endp;
char *origtext;
val->data = NULL;
origtext = xstrdup(text, "make_aliases");
while ((subrcpt = strsep(&text, ",")) != NULL) {
- /* subrcpt: strip initial whitespace. */
- while (isspace((unsigned char)*subrcpt))
- ++subrcpt;
+ /* subrcpt: strip initial and trailing whitespace. */
+ subrcpt = strip(subrcpt);
if (*subrcpt == '\0')
goto error;
- /* subrcpt: strip trailing whitespace. */
- endp = subrcpt + strlen(subrcpt) - 1;
- while (subrcpt < endp && isspace((unsigned char)*endp))
- *endp-- = '\0';
-
if (! text_to_expandnode(&xn, subrcpt))
goto error;
}