Changeset 557:2c8523f9a1c8 for browser.c

Show
Ignore:
Timestamp:
1998-11-10 14:14:00 (10 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Introduce or rewrite mutt_{str*cmp,strlen} and use them all over the
place. If there are still segmentation faults due to missing
NONULLs over, they are gone now.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • browser.c

    r541 r557  
    8686  struct folder_file *pb = (struct folder_file *) b; 
    8787 
    88   int r = strcmp (pa->name, pb->name); 
     88  int r = mutt_strcmp (pa->name, pb->name); 
    8989 
    9090  return ((BrowserSort & SORT_REVERSE) ? -r : r); 
     
    359359  while ((de = readdir (dp)) != NULL) 
    360360  { 
    361     if (strcmp (de->d_name, ".") == 0) 
     361    if (mutt_strcmp (de->d_name, ".") == 0) 
    362362      continue;    /* we don't need . */ 
    363363     
    364     if (prefix && *prefix && strncmp (prefix, de->d_name, strlen (prefix)) != 0) 
     364    if (prefix && *prefix && mutt_strncmp (prefix, de->d_name, mutt_strlen (prefix)) != 0) 
    365365      continue; 
    366366    if (!((regexec (Mask.rx, de->d_name, 0, NULL, 0) == 0) ^ Mask.not)) 
     
    376376     
    377377    tmp = Incoming; 
    378     while (tmp && strcmp (buffer, NONULL(tmp->path))) 
     378    while (tmp && mutt_strcmp (buffer, tmp->path)) 
    379379      tmp = tmp->next; 
    380380    add_folder (menu, state, de->d_name, &s, (tmp) ? tmp->new : 0); 
     
    473473  { 
    474474    mutt_expand_path (f, flen); 
    475     for (i = strlen (f) - 1; i > 0 && f[i] != '/' ; i--); 
     475    for (i = mutt_strlen (f) - 1; i > 0 && f[i] != '/' ; i--); 
    476476    if (i > 0) 
    477477    { 
     
    560560            strfcpy (OldLastDir, LastDir, sizeof (OldLastDir)); 
    561561 
    562             if (strcmp (state.entry[menu->current].name, "..") == 0) 
     562            if (mutt_strcmp (state.entry[menu->current].name, "..") == 0) 
    563563            { 
    564               if (strcmp ("..", LastDir + strlen (LastDir) - 2) == 0) 
     564              if (mutt_strcmp ("..", LastDir + mutt_strlen (LastDir) - 2) == 0) 
    565565                strcat (LastDir, "/.."); 
    566566              else 
     
    585585            } 
    586586            else 
    587               sprintf (LastDir + strlen (LastDir), "/%s", 
     587              sprintf (LastDir + mutt_strlen (LastDir), "/%s", 
    588588                       state.entry[menu->current].name); 
    589589 
     
    637637        strfcpy (buf, LastDir, sizeof (buf)); 
    638638        {/* add '/' at the end of the directory name */ 
    639         int len=strlen(LastDir); 
     639        int len=mutt_strlen(LastDir); 
    640640        if (sizeof (buf) > len) 
    641641          buf[len]='/';