|
Packit |
a71c51 |
/* savestring.c - function version of savestring for backwards compatibility */
|
|
Packit |
a71c51 |
|
|
Packit |
a71c51 |
/* Copyright (C) 1998,2003 Free Software Foundation, Inc.
|
|
Packit |
a71c51 |
|
|
Packit |
a71c51 |
This file is part of the GNU Readline Library (Readline), a library
|
|
Packit |
a71c51 |
for reading lines of text with interactive input and history editing.
|
|
Packit |
a71c51 |
|
|
Packit |
a71c51 |
Readline is free software: you can redistribute it and/or modify
|
|
Packit |
a71c51 |
it under the terms of the GNU General Public License as published by
|
|
Packit |
a71c51 |
the Free Software Foundation, either version 3 of the License, or
|
|
Packit |
a71c51 |
(at your option) any later version.
|
|
Packit |
a71c51 |
|
|
Packit |
a71c51 |
Readline is distributed in the hope that it will be useful,
|
|
Packit |
a71c51 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
a71c51 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
a71c51 |
GNU General Public License for more details.
|
|
Packit |
a71c51 |
|
|
Packit |
a71c51 |
You should have received a copy of the GNU General Public License
|
|
Packit |
a71c51 |
along with Readline. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
a71c51 |
*/
|
|
Packit |
a71c51 |
|
|
Packit |
a71c51 |
#define READLINE_LIBRARY
|
|
Packit |
a71c51 |
|
|
Packit |
a71c51 |
#include <config.h>
|
|
Packit |
a71c51 |
#ifdef HAVE_STRING_H
|
|
Packit |
a71c51 |
# include <string.h>
|
|
Packit |
a71c51 |
#endif
|
|
Packit |
a71c51 |
#include "xmalloc.h"
|
|
Packit |
a71c51 |
|
|
Packit |
a71c51 |
/* Backwards compatibility, now that savestring has been removed from
|
|
Packit |
a71c51 |
all `public' readline header files. */
|
|
Packit |
a71c51 |
char *
|
|
Packit |
a71c51 |
savestring (s)
|
|
Packit |
a71c51 |
const char *s;
|
|
Packit |
a71c51 |
{
|
|
Packit |
a71c51 |
char *ret;
|
|
Packit |
a71c51 |
|
|
Packit |
a71c51 |
ret = (char *)xmalloc (strlen (s) + 1);
|
|
Packit |
a71c51 |
strcpy (ret, s);
|
|
Packit |
a71c51 |
return ret;
|
|
Packit |
a71c51 |
}
|