#include <lib-lib/str.h>
#include <lib-lib/macros.h>
#include <lib-lib/file.h>
+#include <lib-lib/mapping.h>
#include "mutt.h"
#include "enter.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "buffy.h"
-#include "mapping.h"
#include "sort.h"
#include "browser.h"
#include "attach.h"
(!S_ISLNK (s.st_mode)))
continue;
- strfcpy (buffer, NONULL (tmp->path), sizeof (buffer));
+ m_strcpy(buffer, sizeof(buffer), NONULL(tmp->path));
mutt_pretty_mailbox (buffer);
add_folder (menu, state, buffer, &s, NULL, tmp->new);
else
#endif
if (buffy)
- snprintf (title, titlelen, _("Mailboxes [%d]"), buffy_check (0));
+ snprintf(title, titlelen, _("Mailboxes [%d]"), buffy_check(0));
else {
- strfcpy (path, LastDir, sizeof (path));
+ m_strcpy(path, sizeof(path), LastDir);
mutt_pretty_mailbox (path);
#ifdef USE_IMAP
if (state->imap_browse && option (OPTIMAPLSUB))
p_clear(&state, 1);
if (!folder)
- strfcpy (LastDirBackup, LastDir, sizeof (LastDirBackup));
+ m_strcpy(LastDirBackup, sizeof(LastDirBackup), LastDir);
#ifdef USE_NNTP
if (option (OPTNEWS)) {
if (*f)
- strfcpy (prefix, f, sizeof (prefix));
+ m_strcpy(prefix, sizeof(prefix), f);
else {
LIST *list;
init_state (&state, NULL);
state.imap_browse = 1;
if (!imap_browse (f, &state))
- strfcpy (LastDir, state.folder, sizeof (LastDir));
+ m_strcpy(LastDir, sizeof(LastDir), state.folder);
}
else {
#endif
}
if (i <= 0 && f[0] != '/')
- strfcpy (prefix, f, sizeof (prefix));
+ m_strcpy(prefix, sizeof(prefix), f);
else
- strfcpy (prefix, f + i + 1, sizeof (prefix));
+ m_strcpy(prefix, sizeof(prefix), f + i + 1);
killPrefix = 1;
#ifdef USE_IMAP
}
if (!folder)
getcwd (LastDir, sizeof (LastDir));
else if (!LastDir[0])
- strfcpy (LastDir, NONULL (Maildir), sizeof (LastDir));
+ m_strcpy(LastDir, sizeof(LastDir), NONULL(Maildir));
#ifdef USE_IMAP
if (!buffy && imap_is_magic (LastDir, NULL) == M_IMAP) {
) {
/* make sure this isn't a MH or maildir mailbox */
if (buffy) {
- strfcpy (buf, state.entry[menu->current].name, sizeof (buf));
+ m_strcpy(buf, sizeof(buf), state.entry[menu->current].name);
mutt_expand_path (buf, sizeof (buf));
}
#ifdef USE_IMAP
else if (state.imap_browse) {
- strfcpy (buf, state.entry[menu->current].name, sizeof (buf));
+ m_strcpy(buf, sizeof(buf), state.entry[menu->current].name);
}
#endif
else
char OldLastDir[_POSIX_PATH_MAX];
/* save the old directory */
- strfcpy (OldLastDir, LastDir, sizeof (OldLastDir));
+ m_strcpy(OldLastDir, sizeof(OldLastDir), LastDir);
if (m_strcmp(state.entry[menu->current].name, "..") == 0) {
if (m_strcmp("..", LastDir + m_strlen(LastDir) - 2) == 0)
}
}
else if (buffy) {
- strfcpy (LastDir, state.entry[menu->current].name,
- sizeof (LastDir));
+ m_strcpy(LastDir, sizeof(LastDir),
+ state.entry[menu->current].name);
mutt_expand_path (LastDir, sizeof (LastDir));
}
#ifdef USE_IMAP
int n;
ciss_url_t url;
- strfcpy (LastDir, state.entry[menu->current].name,
- sizeof (LastDir));
+ m_strcpy(LastDir, sizeof(LastDir),
+ state.entry[menu->current].name);
/* tack on delimiter here */
n = m_strlen(LastDir) + 1;
mutt_concat_path(tmp, sizeof(tmp), LastDir,
state.entry[menu->current].name);
- strfcpy (LastDir, tmp, sizeof (LastDir));
+ m_strcpy(LastDir, sizeof(LastDir), tmp);
}
destroy_state (&state);
#endif
if (examine_directory (menu, &state, LastDir, prefix) == -1) {
/* try to restore the old values */
- strfcpy (LastDir, OldLastDir, sizeof (LastDir));
+ m_strcpy(LastDir, sizeof(LastDir), OldLastDir);
if (examine_directory (menu, &state, LastDir, prefix) == -1) {
- strfcpy (LastDir, NONULL (Homedir), sizeof (LastDir));
+ m_strcpy(LastDir, sizeof(LastDir), NONULL(Homedir));
goto bail;
}
}
if (buffy)
#endif
{
- strfcpy (f, state.entry[menu->current].name, flen);
+ m_strcpy(f, flen, state.entry[menu->current].name);
mutt_expand_path (f, flen);
}
#ifdef USE_IMAP
else if (state.imap_browse)
- strfcpy (f, state.entry[menu->current].name, flen);
+ m_strcpy(f, flen, state.entry[menu->current].name);
#endif
else
mutt_concat_path(f, flen, LastDir, state.entry[menu->current].name);
break;
#endif
- strfcpy (buf, LastDir, sizeof (buf));
+ m_strcpy(buf, sizeof(buf), LastDir);
#ifdef USE_IMAP
if (!state.imap_browse)
#endif
mutt_expand_path (buf, sizeof (buf));
#ifdef USE_IMAP
if (imap_is_magic (buf, NULL) == M_IMAP) {
- strfcpy (LastDir, buf, sizeof (LastDir));
+ m_strcpy(LastDir, sizeof(LastDir), buf);
destroy_state (&state);
init_state (&state, NULL);
state.imap_browse = 1;
if (S_ISDIR (st.st_mode)) {
destroy_state (&state);
if (examine_directory (menu, &state, buf, prefix) == 0)
- strfcpy (LastDir, buf, sizeof (LastDir));
+ m_strcpy(LastDir, sizeof(LastDir), buf);
else {
mutt_error _("Error scanning directory.");
case OP_ENTER_MASK:
- strfcpy (buf, NONULL (Mask.pattern), sizeof (buf));
+ m_strcpy(buf, sizeof(buf), NONULL(Mask.pattern));
if (mutt_get_field (_("File Mask: "), buf, sizeof (buf), 0) == 0) {
regex_t *rx = p_new(regex_t, 1);
char *s = buf;
buffy = 0;
/* assume that the user wants to see everything */
if (!buf[0])
- strfcpy (buf, ".", sizeof (buf));
- SKIPWS (s);
+ m_strcpy(buf, sizeof(buf), ".");
+ s = vskipspaces(s);
if (*s == '!') {
- s++;
- SKIPWS (s);
+ s = vskipspaces(s + 1);
not = 1;
}
mutt_error ("%s", buf);
}
else {
- str_replace (&Mask.pattern, buf);
+ m_strreplace(&Mask.pattern, buf);
regfree (Mask.rx);
p_delete(&Mask.rx);
Mask.rx = rx;
snprintf (buf, sizeof (buf), "%s/", LastDir);
if (mutt_get_field (_("New file name: "), buf, sizeof (buf), M_FILE) ==
0) {
- strfcpy (f, buf, flen);
+ m_strcpy(f, flen, buf);
destroy_state (&state);
mutt_menuDestroy (&menu);
goto bail;
#ifdef USE_IMAP
if (state.entry[menu->current].selectable) {
- strfcpy (f, state.entry[menu->current].name, flen);
+ m_strcpy(f, flen, state.entry[menu->current].name);
destroy_state (&state);
mutt_menuDestroy (&menu);
goto bail;
bail:
if (!folder)
- strfcpy (LastDir, LastDirBackup, sizeof (LastDir));
+ m_strcpy(LastDir, sizeof(LastDir), LastDirBackup);
}