diff options
author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-07-05 19:00:47 +0000 |
---|---|---|
committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-07-05 19:00:47 +0000 |
commit | 9efd582dc713b90a69682538ec34579a2bd38afb (patch) | |
tree | 3a1c4ca9a5a873f39efe93d88528315c2f339090 /libbb | |
parent | 4b571c9dee2f7b1f327debec38811bd862219610 (diff) | |
download | busybox-w32-9efd582dc713b90a69682538ec34579a2bd38afb.tar.gz busybox-w32-9efd582dc713b90a69682538ec34579a2bd38afb.tar.bz2 busybox-w32-9efd582dc713b90a69682538ec34579a2bd38afb.zip |
Removed obsolete function, strdup_substr.
git-svn-id: svn://busybox.net/trunk/busybox@3010 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/dirname.c | 2 | ||||
-rw-r--r-- | libbb/libbb.h | 4 | ||||
-rw-r--r-- | libbb/strdup_substr.c | 34 |
3 files changed, 1 insertions, 39 deletions
diff --git a/libbb/dirname.c b/libbb/dirname.c index cc50f5870..5f839945d 100644 --- a/libbb/dirname.c +++ b/libbb/dirname.c | |||
@@ -45,5 +45,5 @@ char *dirname(const char *path) | |||
45 | if (s < path) | 45 | if (s < path) |
46 | return xstrdup ("."); | 46 | return xstrdup ("."); |
47 | else | 47 | else |
48 | return strdup_substr (path, 0, s - path + 1); | 48 | return xstrndup (path, s - path + 1); |
49 | } | 49 | } |
diff --git a/libbb/libbb.h b/libbb/libbb.h index c29955b3b..0fc704501 100644 --- a/libbb/libbb.h +++ b/libbb/libbb.h | |||
@@ -254,10 +254,6 @@ extern struct hostent *xgethostbyname(const char *name); | |||
254 | 254 | ||
255 | char *dirname (const char *path); | 255 | char *dirname (const char *path); |
256 | 256 | ||
257 | static inline char *strdup_substr (const char *s, int start, int end) | ||
258 | { | ||
259 | return xstrndup (s+start, end-start); | ||
260 | } | ||
261 | int make_directory (char *path, mode_t mode, int flags); | 257 | int make_directory (char *path, mode_t mode, int flags); |
262 | 258 | ||
263 | #define CT_AUTO 0 | 259 | #define CT_AUTO 0 |
diff --git a/libbb/strdup_substr.c b/libbb/strdup_substr.c deleted file mode 100644 index 85030b11a..000000000 --- a/libbb/strdup_substr.c +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Mini strdup_substr function. | ||
4 | * | ||
5 | * Copyright (C) 2001 Mark Whitley. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | /* Return a substring of STR, starting at index START and ending at END, | ||
23 | * allocated on the heap. */ | ||
24 | |||
25 | #include "libbb.h" | ||
26 | |||
27 | char *strdup_substr(const char *str, int start, int end) | ||
28 | { | ||
29 | int size = end - start + 1; | ||
30 | char *newstr = xmalloc(size); | ||
31 | memcpy(newstr, str+start, size-1); | ||
32 | newstr[size-1] = '\0'; | ||
33 | return newstr; | ||
34 | } | ||