summaryrefslogtreecommitdiff
path: root/mailbox/mutil.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-08-21 19:32:21 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-08-21 19:32:21 +0000
commit734eac29073067b1d4b23bae168b795f4361d3f0 (patch)
tree219496e4b016c37b3b3669b18af0cb2ed3055a4a /mailbox/mutil.c
parent0255df9a66adad110a45b56a3511b80865725fd0 (diff)
downloadmailutils-734eac29073067b1d4b23bae168b795f4361d3f0.tar.gz
mailutils-734eac29073067b1d4b23bae168b795f4361d3f0.tar.bz2
* include/mailutils/mutil.h, mailbox/mutil.c (mu_normalize_path):
Remove useless second argument. All callers changed.
Diffstat (limited to 'mailbox/mutil.c')
-rw-r--r--mailbox/mutil.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/mailbox/mutil.c b/mailbox/mutil.c
index 89fab1896..6f0f2d360 100644
--- a/mailbox/mutil.c
+++ b/mailbox/mutil.c
@@ -495,10 +495,9 @@ mu_get_user_email (const char *name)
/home/user/../smith --> /home/smith
/home/user/../.. --> /
- FIXME: delim is superfluous. The function deals with unix filesystem
- paths, so delim should be always "/" */
+*/
char *
-mu_normalize_path (char *path, const char *delim)
+mu_normalize_path (char *path)
{
int len;
char *p;
@@ -513,21 +512,21 @@ mu_normalize_path (char *path, const char *delim)
return path;
/* delete trailing delimiter if any */
- if (len && path[len-1] == delim[0])
+ if (len && path[len-1] == '/')
path[len-1] = 0;
/* Eliminate any /../ */
for (p = strchr (path, '.'); p; p = strchr (p, '.'))
{
- if (p > path && p[-1] == delim[0])
+ if (p > path && p[-1] == '/')
{
- if (p[1] == '.' && (p[2] == 0 || p[2] == delim[0]))
+ if (p[1] == '.' && (p[2] == 0 || p[2] == '/'))
/* found */
{
char *q, *s;
/* Find previous delimiter */
- for (q = p-2; *q != delim[0] && q >= path; q--)
+ for (q = p-2; *q != '/' && q >= path; q--)
;
if (q < path)
@@ -546,7 +545,7 @@ mu_normalize_path (char *path, const char *delim)
if (path[0] == 0)
{
- path[0] = delim[0];
+ path[0] = '/';
path[1] = 0;
}

Return to:

Send suggestions and report system problems to the System administrator.