1 |
/* GNU Mailutils -- a suite of utilities for electronic mail |
/* GNU Mailutils -- a suite of utilities for electronic mail |
2 |
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. |
Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. |
3 |
|
|
4 |
This library is free software; you can redistribute it and/or |
This library is free software; you can redistribute it and/or |
5 |
modify it under the terms of the GNU Lesser General Public |
modify it under the terms of the GNU Lesser General Public |
43 |
#define USE_ENVIRON 1 |
#define USE_ENVIRON 1 |
44 |
|
|
45 |
static int |
static int |
46 |
|
is_proto (char *p) |
47 |
|
{ |
48 |
|
for (; *p && *p != '/'; p++) |
49 |
|
if (*p == ':') |
50 |
|
return 1; |
51 |
|
return 0; |
52 |
|
} |
53 |
|
|
54 |
|
static int |
55 |
split_shortcut (const char *file, const char pfx[], char **user, char **rest) |
split_shortcut (const char *file, const char pfx[], char **user, char **rest) |
56 |
{ |
{ |
57 |
*user = NULL; |
*user = NULL; |
184 |
char *home; |
char *home; |
185 |
int status, len; |
int status, len; |
186 |
|
|
187 |
if ((status = split_shortcut (file, "+=", &user, &path))) |
if ((status = split_shortcut (file, "+=", &path, &user))) |
188 |
return status; |
return status; |
189 |
|
|
190 |
if (!path) |
if (!path) |
201 |
return ENOENT; |
return ENOENT; |
202 |
} |
} |
203 |
|
|
204 |
if (mu_path_folder_dir[0] == '/') |
if (mu_path_folder_dir[0] == '/' || is_proto (mu_path_folder_dir)) |
205 |
{ |
{ |
206 |
len = strlen (mu_path_folder_dir) + strlen (path) + 2; |
len = strlen (mu_path_folder_dir) + strlen (path) + 2; |
207 |
*buf = malloc (len); |
*buf = malloc (len); |
343 |
break; |
break; |
344 |
|
|
345 |
default: |
default: |
346 |
if (!strchr (mail, ':')) |
if (!is_proto (mail)) |
347 |
{ |
{ |
348 |
tmp_mbox = mu_getcwd(); |
tmp_mbox = mu_getcwd(); |
349 |
mbox = malloc (strlen (tmp_mbox) + strlen (mail) + 2); |
mbox = malloc (strlen (tmp_mbox) + strlen (mail) + 2); |