summaryrefslogtreecommitdiffstats
path: root/complete.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-11-10 22:14:00 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-11-10 22:14:00 +0000
commita3f726e35f1e7d918061074a85ebe7a2c7c300a5 (patch)
treed9ab2a281be2a13fbb1ec8682d4e5c7ff0502cde /complete.c
parent912c6b0df82fe3a2745d68131db9300222226a73 (diff)
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.
Diffstat (limited to 'complete.c')
-rw-r--r--complete.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/complete.c b/complete.c
index 3cd63d41..e7bd5e1e 100644
--- a/complete.c
+++ b/complete.c
@@ -48,8 +48,8 @@ int mutt_complete (char *s)
if ((p = strrchr (s, '/')))
{
*p++ = 0;
- sprintf (exp_dirpart + strlen (exp_dirpart), "/%s", s+1);
- sprintf (dirpart + strlen (dirpart), "%s/", s+1);
+ sprintf (exp_dirpart + mutt_strlen (exp_dirpart), "/%s", s+1);
+ sprintf (dirpart + mutt_strlen (dirpart), "%s/", s+1);
strfcpy (filepart, p, sizeof (filepart));
}
else
@@ -100,11 +100,11 @@ int mutt_complete (char *s)
* special case to handle when there is no filepart yet. find the first
* file/directory which is not ``.'' or ``..''
*/
- if ((len = strlen (filepart)) == 0)
+ if ((len = mutt_strlen (filepart)) == 0)
{
while ((de = readdir (dirp)) != NULL)
{
- if (strcmp (".", de->d_name) != 0 && strcmp ("..", de->d_name) != 0)
+ if (mutt_strcmp (".", de->d_name) != 0 && mutt_strcmp ("..", de->d_name) != 0)
{
strfcpy (filepart, de->d_name, sizeof (filepart));
init++;
@@ -115,7 +115,7 @@ int mutt_complete (char *s)
while ((de = readdir (dirp)) != NULL)
{
- if (strncmp (de->d_name, filepart, len) == 0)
+ if (mutt_strncmp (de->d_name, filepart, len) == 0)
{
if (init)
{
@@ -156,7 +156,7 @@ int mutt_complete (char *s)
if (dirpart[0])
{
strcpy (s, dirpart);
- if (strcmp ("/", dirpart) != 0 && dirpart[0] != '=' && dirpart[0] != '+')
+ if (mutt_strcmp ("/", dirpart) != 0 && dirpart[0] != '=' && dirpart[0] != '+')
strcat (s, "/");
strcat (s, filepart);
}