diff --git a/wordsplit.at b/wordsplit.at index 7ecc016..13f2f84 100644 --- a/wordsplit.at +++ b/wordsplit.at @@ -1,18 +1,18 @@ -# This file is part of grecs -*- Autotest -*- -# Copyright (C) 2014-2018 Sergey Poznyakoff +# Test suite for wordsplit -*- Autotest -*- +# Copyright (C) 2014-2019 Sergey Poznyakoff # -# Grecs is free software; you can redistribute it and/or modify +# Wordsplit is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # -# Grecs is distributed in the hope that it will be useful, +# Wordsplit is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with Grecs. If not, see . +# along with wordsplit. If not, see . AT_BANNER(Wordsplit) diff --git a/wsp.c b/wsp.c index 958d01f..6f8cdc7 100644 --- a/wsp.c +++ b/wsp.c @@ -1,18 +1,18 @@ -/* grecs - Gray's Extensible Configuration System +/* wsp - test program for wordsplit Copyright (C) 2014-2019 Sergey Poznyakoff - Grecs is free software; you can redistribute it and/or modify it + Wordsplit is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - Grecs is distributed in the hope that it will be useful, + Wordsplit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along - with Grecs. If not, see . */ + with wordsplit. If not, see . */ #ifdef HAVE_CONFIG_H # include @@ -22,7 +22,6 @@ #include #include #include -#include "grecs.h" #include "wordsplit.h" extern char **environ; @@ -592,6 +591,7 @@ wsp_runcmd (char **ret, const char *str, size_t len, char **argv, void *closure) { int i; size_t s = 0; + char const msg[] = "unknown command: "; for (i = 0; ; i++) { @@ -601,11 +601,11 @@ wsp_runcmd (char **ret, const char *str, size_t len, char **argv, void *closure) return comtab[i].cmd (ret, str, len, argv); } - *ret = NULL; - if (grecs_asprintf (ret, &s, "unknown command: %s", argv[0])) + *ret = malloc (sizeof (msg) + strlen (argv[0])); + if (!*ret) return WRDSE_NOSPACE; - else - return WRDSE_USERERR; + strcat (strcpy (*ret, msg), argv[0]); + return WRDSE_USERERR; } int