/[mailutils]/mailutils/mailbox/mbx_default.c
ViewVC logotype

Diff of /mailutils/mailbox/mbx_default.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29 by polak, Sun Feb 9 20:39:58 2003 UTC revision 1.30 by gray, Sat Feb 22 22:25:53 2003 UTC
# Line 1  Line 1 
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
# Line 43  const char *mu_path_folder_dir = "Mail"; Line 43  const char *mu_path_folder_dir = "Mail";
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;
# Line 175  plus_expand (const char *file, char **bu Line 184  plus_expand (const char *file, char **bu
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)
# Line 192  plus_expand (const char *file, char **bu Line 201  plus_expand (const char *file, char **bu
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);
# Line 334  mailbox_create_default (mailbox_t *pmbox Line 343  mailbox_create_default (mailbox_t *pmbox
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);

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26