aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sh/makepath.c
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2001-11-13 17:56:06 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:54 +0000
commitf73dda092b33638d2d5e9c35375f687a607b5403 (patch)
treef21584e70a444d6a1ecba0fb5e2cf79e8cce91db /lib/sh/makepath.c
parent28ef6c316f1aff914bb95ac09787a3c83c1815fd (diff)
downloadandroid_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.gz
android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.bz2
android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.zip
Imported from ../bash-2.05a.tar.gz.
Diffstat (limited to 'lib/sh/makepath.c')
-rw-r--r--lib/sh/makepath.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/sh/makepath.c b/lib/sh/makepath.c
index ba2bcb9..13aad3f 100644
--- a/lib/sh/makepath.c
+++ b/lib/sh/makepath.c
@@ -27,7 +27,7 @@
# include <unistd.h>
#endif
-#include "bashansi.h"
+#include <bashansi.h>
#include "shell.h"
#include <tilde/tilde.h>
@@ -56,7 +56,7 @@ extern char *get_working_directory __P((char *));
#define MAKEDOT() \
do { \
- xpath = xmalloc (2); \
+ xpath = (char *)xmalloc (2); \
xpath[0] = '.'; \
xpath[1] = '\0'; \
pathlen = 1; \
@@ -64,11 +64,11 @@ extern char *get_working_directory __P((char *));
char *
sh_makepath (path, dir, flags)
- char *path, *dir;
+ const char *path, *dir;
int flags;
{
int dirlen, pathlen;
- char *ret, *xpath, *r, *s;
+ char *ret, *xpath, *xdir, *r, *s;
if (path == 0 || *path == '\0')
{
@@ -91,24 +91,25 @@ sh_makepath (path, dir, flags)
}
else
{
- xpath = ((flags & MP_DOTILDE) && *path == '~') ? bash_tilde_expand (path) : path;
+ xpath = ((flags & MP_DOTILDE) && *path == '~') ? bash_tilde_expand (path) : (char *)path;
pathlen = strlen (xpath);
}
- dirlen = strlen (dir);
+ xdir = (char *)dir;
+ dirlen = strlen (xdir);
if ((flags & MP_RMDOT) && dir[0] == '.' && dir[1] == '/')
{
- dir += 2;
+ xdir += 2;
dirlen -= 2;
}
- r = ret = xmalloc (2 + dirlen + pathlen);
+ r = ret = (char *)xmalloc (2 + dirlen + pathlen);
s = xpath;
while (*s)
*r++ = *s++;
if (s[-1] != '/')
*r++ = '/';
- s = dir;
+ s = xdir;
while (*r++ = *s++)
;
if (xpath != path)