summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-27 09:49:34 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-27 09:49:34 +0000
commit77e876615da5f1482b225bd4f754b9fefcd52cec (patch)
tree27bc06133685cb3d4bcb75cfc81b3cda6cdf8e04 /util.c
parentf0ba57341ac7815189f7e33c980b8cbb51571efb (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r--util.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/util.c b/util.c
index 63410a1..d305af7 100644
--- a/util.c
+++ b/util.c
@@ -300,7 +300,6 @@ valid_filename(char *s)
#endif
#ifdef DJGPP
-/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <libc/stubs.h>
#include <stdio.h> /* For FILENAME_MAX */
#include <errno.h> /* For errno */
@@ -379,7 +378,7 @@ is_sjis1(int c)
7. Converting all slashes to '/'
*/
void
-_fixpath(const char *in, char *out)
+fixpath(const char *in, char *out)
{
int drive_number;
const char *ip = in;
@@ -758,3 +757,16 @@ void ruby_qsort (base, nel, size, cmp) void* base; int nel; int size; int (*cmp)
}
}
+char *
+ruby_strdup(str)
+ const char *str;
+{
+ char *tmp;
+ int len = strlen(str) + 1;
+
+ tmp = xmalloc(len);
+ if (tmp == NULL) return NULL;
+ memcpy(tmp, str, len);
+
+ return tmp;
+}