Get rid of the grecs dependencies

This commit is contained in:
Sergey Poznyakoff 2019-06-25 17:28:26 +03:00
parent e2f87cfb91
commit 42acf86a10
2 changed files with 14 additions and 14 deletions

View file

@ -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 <http://www.gnu.org/licenses/>.
# along with wordsplit. If not, see <http://www.gnu.org/licenses/>.
AT_BANNER(Wordsplit)

18
wsp.c
View file

@ -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 <http://www.gnu.org/licenses/>. */
with wordsplit. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@ -22,7 +22,6 @@
#include <string.h>
#include <assert.h>
#include <errno.h>
#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