summaryrefslogtreecommitdiff
path: root/gcc/cppalloc.c
diff options
context:
space:
mode:
authorbrolley <brolley@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-15 11:23:27 +0000
committerbrolley <brolley@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-15 11:23:27 +0000
commit9235c69779ca5e45c651139bbe7db74998f8dfb1 (patch)
tree5c481c8ca58453f070db1b092bbe2a81d08d45ca /gcc/cppalloc.c
parent616814f81e771d0eb9b9b7f53c01e9364ad4a066 (diff)
downloadgcc-9235c69779ca5e45c651139bbe7db74998f8dfb1.tar.gz
1998-12-15 Zack Weinberg <zack@rabi.phys.columbia.edu>
* cppalloc.c: Add xstrdup here. * cpplib.h: Remove savestring prototype. * cpplib.c: Remove savestring function. s/savestring/xstrdup/ throughout. * cppfiles.c: s/savestring/xstrdup/ throughout. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24327 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppalloc.c')
-rw-r--r--gcc/cppalloc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cppalloc.c b/gcc/cppalloc.c
index a852d00cb15..880a56dba62 100644
--- a/gcc/cppalloc.c
+++ b/gcc/cppalloc.c
@@ -65,3 +65,13 @@ xrealloc (old, size)
memory_full ();
return ptr;
}
+
+char *
+xstrdup (input)
+ const char *input;
+{
+ unsigned size = strlen (input);
+ char *output = xmalloc (size + 1);
+ strcpy (output, input);
+ return output;
+}