revamp lib.[hc] functions into lib-lib/file.[hc].
[apps/madmutt.git] / browser.c
index 12506b3..3fd3563 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -14,6 +14,7 @@
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/file.h>
 
 #include "mutt.h"
 #include "enter.h"
@@ -154,7 +155,7 @@ static int link_is_dir (const char *folder, const char *path)
   struct stat st;
   char fullpath[_POSIX_PATH_MAX];
 
-  mutt_concat_path (fullpath, folder, path, sizeof (fullpath));
+  mutt_concat_path(fullpath, sizeof(fullpath), folder, path);
 
   if (stat (fullpath, &st) == 0)
     return (S_ISDIR (st.st_mode));
@@ -539,7 +540,7 @@ static int examine_directory (MUTTMENU * menu, struct browser_state *state,
       if (!((regexec (Mask.rx, de->d_name, 0, NULL, 0) == 0) ^ Mask.not))
         continue;
 
-      mutt_concat_path (buffer, d, de->d_name, sizeof (buffer));
+      mutt_concat_path(buffer, sizeof(buffer), d, de->d_name);
       if (lstat (buffer, &s) == -1)
         continue;
 
@@ -879,8 +880,8 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files,
         }
 #endif
         else
-          mutt_concat_path (buf, LastDir, state.entry[menu->current].name,
-                            sizeof (buf));
+          mutt_concat_path(buf, sizeof(buf), LastDir,
+                           state.entry[menu->current].name);
 
         if ((mx_get_magic (buf) <= 0)
 #ifdef USE_IMAP
@@ -936,8 +937,8 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files,
           else {
             char tmp[_POSIX_PATH_MAX];
 
-            mutt_concat_path (tmp, LastDir, state.entry[menu->current].name,
-                              sizeof (tmp));
+            mutt_concat_path(tmp, sizeof(tmp), LastDir,
+                             state.entry[menu->current].name);
             strfcpy (LastDir, tmp, sizeof (LastDir));
           }
 
@@ -986,7 +987,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files,
         strfcpy (f, state.entry[menu->current].name, flen);
 #endif
       else
-        mutt_concat_path (f, LastDir, state.entry[menu->current].name, flen);
+        mutt_concat_path(f, flen, LastDir, state.entry[menu->current].name);
 
       /* Fall through to OP_EXIT */
 
@@ -1004,7 +1005,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files,
             char full[_POSIX_PATH_MAX];
 
             if (ff.tagged) {
-              mutt_concat_path (full, LastDir, ff.name, sizeof (full));
+              mutt_concat_path(full, sizeof(full), LastDir, ff.name);
               mutt_expand_path (full, sizeof (full));
               tfiles[j++] = m_strdup(full);
             }
@@ -1358,8 +1359,8 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files,
         BODY *b;
         char buf[_POSIX_PATH_MAX];
 
-        mutt_concat_path (buf, LastDir, state.entry[menu->current].name,
-                          sizeof (buf));
+        mutt_concat_path(buf, sizeof(buf), LastDir,
+                         state.entry[menu->current].name);
         b = mutt_make_file_attach (buf);
         if (b != NULL) {
           mutt_view_attachment (NULL, b, M_REGULAR, NULL, NULL, 0);