use m_strdup and m_strlen that are inlined for efficiency
[apps/madmutt.git] / complete.c
index f451e1a..a385af4 100644 (file)
@@ -20,7 +20,7 @@
 #include "nntp.h"
 #endif
 
 #include "nntp.h"
 #endif
 
-#include "lib/str.h"
+#include <lib-lib/str.h>
 #include "lib/debug.h"
 
 #include <dirent.h>
 #include "lib/debug.h"
 
 #include <dirent.h>
@@ -60,7 +60,7 @@ int mutt_complete (char *s, size_t slen)
      * special case to handle when there is no filepart yet.
      * find the first subscribed newsgroup
      */
      * special case to handle when there is no filepart yet.
      * find the first subscribed newsgroup
      */
-    if ((len = str_len (filepart)) == 0) {
+    if ((len = m_strlen(filepart)) == 0) {
       for (; l; l = l->next) {
         NNTP_DATA *data = (NNTP_DATA *) l->data;
 
       for (; l; l = l->next) {
         NNTP_DATA *data = (NNTP_DATA *) l->data;
 
@@ -172,7 +172,7 @@ int mutt_complete (char *s, size_t slen)
    * special case to handle when there is no filepart yet.  find the first
    * file/directory which is not ``.'' or ``..''
    */
    * special case to handle when there is no filepart yet.  find the first
    * file/directory which is not ``.'' or ``..''
    */
-  if ((len = str_len (filepart)) == 0) {
+  if ((len = m_strlen(filepart)) == 0) {
     while ((de = readdir (dirp)) != NULL) {
       if (str_cmp (".", de->d_name) != 0
           && str_cmp ("..", de->d_name) != 0) {
     while ((de = readdir (dirp)) != NULL) {
       if (str_cmp (".", de->d_name) != 0
           && str_cmp ("..", de->d_name) != 0) {
@@ -203,14 +203,14 @@ int mutt_complete (char *s, size_t slen)
         /* check to see if it is a directory */
         if (dirpart[0]) {
           strfcpy (buf, exp_dirpart, sizeof (buf));
         /* check to see if it is a directory */
         if (dirpart[0]) {
           strfcpy (buf, exp_dirpart, sizeof (buf));
-          strfcpy (buf + str_len (buf), "/", sizeof (buf) - str_len (buf));
+          strfcpy (buf + m_strlen(buf), "/", sizeof (buf) - m_strlen(buf));
         }
         else
           buf[0] = 0;
         }
         else
           buf[0] = 0;
-        strfcpy (buf + str_len (buf), filepart, sizeof (buf) - str_len (buf));
+        strfcpy (buf + m_strlen(buf), filepart, sizeof (buf) - m_strlen(buf));
         if (stat (buf, &st) != -1 && (st.st_mode & S_IFDIR))
         if (stat (buf, &st) != -1 && (st.st_mode & S_IFDIR))
-          strfcpy (filepart + str_len (filepart), "/",
-                   sizeof (filepart) - str_len (filepart));
+          strfcpy (filepart + m_strlen(filepart), "/",
+                   sizeof (filepart) - m_strlen(filepart));
         init = 1;
       }
     }
         init = 1;
       }
     }
@@ -221,8 +221,8 @@ int mutt_complete (char *s, size_t slen)
     strfcpy (s, dirpart, slen);
     if (str_cmp ("/", dirpart) != 0 && dirpart[0] != '='
         && dirpart[0] != '+')
     strfcpy (s, dirpart, slen);
     if (str_cmp ("/", dirpart) != 0 && dirpart[0] != '='
         && dirpart[0] != '+')
-      strfcpy (s + str_len (s), "/", slen - str_len (s));
-    strfcpy (s + str_len (s), filepart, slen - str_len (s));
+      strfcpy (s + m_strlen(s), "/", slen - m_strlen(s));
+    strfcpy (s + m_strlen(s), filepart, slen - m_strlen(s));
   }
   else
     strfcpy (s, filepart, slen);
   }
   else
     strfcpy (s, filepart, slen);