diff options
author | dim <dim@FreeBSD.org> | 2010-10-21 19:11:14 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-10-21 19:11:14 +0000 |
commit | 844d5c9852c83cc56dccdc017c27f2bfc0928f05 (patch) | |
tree | 506464413c40d2c6a4a46d04892a9415cb886522 /contrib/binutils/libiberty/make-relative-prefix.c | |
parent | acc1b913a3297e19f9ffe7d2b7b8a3142926d3b4 (diff) | |
parent | 0acbbeece75076693a5c54ce4d376aa9f021b4e3 (diff) | |
download | FreeBSD-src-844d5c9852c83cc56dccdc017c27f2bfc0928f05.zip FreeBSD-src-844d5c9852c83cc56dccdc017c27f2bfc0928f05.tar.gz |
Merge ^vendor/binutils/dist@214082 into contrib/binutils.
Diffstat (limited to 'contrib/binutils/libiberty/make-relative-prefix.c')
-rw-r--r-- | contrib/binutils/libiberty/make-relative-prefix.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/contrib/binutils/libiberty/make-relative-prefix.c b/contrib/binutils/libiberty/make-relative-prefix.c index dc4f8d5..66ddcaa 100644 --- a/contrib/binutils/libiberty/make-relative-prefix.c +++ b/contrib/binutils/libiberty/make-relative-prefix.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ +Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA +02110-1301, USA. */ /* @@ -95,16 +95,14 @@ relative prefix can be found, return @code{NULL}. #define DIR_UP ".." -static char *save_string PARAMS ((const char *, int)); -static char **split_directories PARAMS ((const char *, int *)); -static void free_split_directories PARAMS ((char **)); +static char *save_string (const char *, int); +static char **split_directories (const char *, int *); +static void free_split_directories (char **); static char * -save_string (s, len) - const char *s; - int len; +save_string (const char *s, int len) { - char *result = malloc (len + 1); + char *result = (char *) malloc (len + 1); memcpy (result, s, len); result[len] = 0; @@ -114,9 +112,7 @@ save_string (s, len) /* Split a filename into component directories. */ static char ** -split_directories (name, ptr_num_dirs) - const char *name; - int *ptr_num_dirs; +split_directories (const char *name, int *ptr_num_dirs) { int num_dirs = 0; char **dirs; @@ -201,8 +197,7 @@ split_directories (name, ptr_num_dirs) /* Release storage held by split directories. */ static void -free_split_directories (dirs) - char **dirs; +free_split_directories (char **dirs) { int i = 0; @@ -223,10 +218,8 @@ free_split_directories (dirs) If no relative prefix can be found, return NULL. */ char * -make_relative_prefix (progname, bin_prefix, prefix) - const char *progname; - const char *bin_prefix; - const char *prefix; +make_relative_prefix (const char *progname, + const char *bin_prefix, const char *prefix) { char **prog_dirs, **bin_dirs, **prefix_dirs; int prog_num, bin_num, prefix_num; |