i-bash/lib/readline/savestring.c

42 lines
1.3 KiB
C
Raw Normal View History

2009-01-12 13:36:28 +00:00
/* savestring.c - function version of savestring for backwards compatibility */
1999-02-19 17:11:39 +00:00
2004-07-27 13:29:18 +00:00
/* Copyright (C) 1998,2003 Free Software Foundation, Inc.
1999-02-19 17:11:39 +00:00
2009-01-12 13:36:28 +00:00
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
1999-02-19 17:11:39 +00:00
2009-01-12 13:36:28 +00:00
Readline 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
1999-02-19 17:11:39 +00:00
(at your option) any later version.
2009-01-12 13:36:28 +00:00
Readline 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
1999-02-19 17:11:39 +00:00
GNU General Public License for more details.
2009-01-12 13:36:28 +00:00
You should have received a copy of the GNU General Public License
along with Readline. If not, see <http://www.gnu.org/licenses/>.
*/
2004-07-27 13:29:18 +00:00
#define READLINE_LIBRARY
1999-02-19 17:11:39 +00:00
2001-11-13 17:56:06 +00:00
#include <config.h>
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#include "xmalloc.h"
1999-02-19 17:11:39 +00:00
/* Backwards compatibility, now that savestring has been removed from
all `public' readline header files. */
char *
savestring (s)
2001-04-06 19:14:31 +00:00
const char *s;
1999-02-19 17:11:39 +00:00
{
char *ret;
ret = (char *)xmalloc (strlen (s) + 1);
strcpy (ret, s);
return ret;
1999-02-19 17:11:39 +00:00
}