if (op == OP_CHANGE_DIRECTORY)
{
/* buf comes from the buffer pool, so defaults to size 1024 */
- int ret = mutt_get_field(_("Chdir to: "), buf->data, buf->dsize, MUTT_FILE);
- if ((ret != 0) && (mutt_b2s(buf)[0] == '\0'))
+ int ret = mutt_buffer_get_field(_("Chdir to: "), buf, MUTT_FILE);
+ if ((ret != 0) && mutt_buffer_is_empty(buf))
break;
}
else if (op == OP_GOTO_PARENT)
if (mutt_b2s(buf)[0] != '\0')
{
- mutt_buffer_fix_dptr(buf);
mailbox = false;
mutt_buffer_expand_path(buf);
#ifdef USE_IMAP
case OP_BROWSER_NEW_FILE:
mutt_buffer_printf(buf, "%s/", mutt_b2s(&LastDir));
/* buf comes from the buffer pool, so defaults to size 1024 */
- if (mutt_get_field(_("New file name: "), buf->data, buf->dsize, MUTT_FILE) == 0)
+ if (mutt_buffer_get_field(_("New file name: "), buf, MUTT_FILE) == 0)
{
mutt_buffer_strcpy(file, mutt_b2s(buf));
destroy_state(&state);
else
snprintf(tmp2, sizeof(tmp2), _("Unsubscribe pattern: "));
/* buf comes from the buffer pool, so defaults to size 1024 */
- if ((mutt_get_field(tmp2, buf->data, buf->dsize, 0) != 0) ||
- (mutt_b2s(buf)[0] == '\0'))
+ if ((mutt_buffer_get_field(tmp2, buf, 0) != 0) || mutt_buffer_is_empty(buf))
{
break;
}
mutt_unget_event(0, ch.op);
mutt_buffer_alloc(fname, 1024);
- if (mutt_get_field_full(pc, fname->data, fname->dsize,
- (mailbox ? MUTT_EFILE : MUTT_FILE) | MUTT_CLEAR,
- multiple, files, numfiles) != 0)
+ if (mutt_buffer_get_field_full(pc, fname, (mailbox ? MUTT_EFILE : MUTT_FILE) | MUTT_CLEAR,
+ multiple, files, numfiles) != 0)
+ {
mutt_buffer_reset(fname);
- else
- mutt_buffer_fix_dptr(fname);
+ }
FREE(&pc);
}
struct Buffer *tmp = mutt_buffer_pool_get();
mutt_buffer_strcpy(tmp, mutt_path_basename(NONULL(attname)));
- if (mutt_get_field(_("File under directory: "), tmp->data, tmp->dsize,
- MUTT_FILE | MUTT_CLEAR) != 0)
- {
- mutt_buffer_pool_release(&tmp);
- return -1;
- }
- mutt_buffer_fix_dptr(tmp);
- if (mutt_buffer_is_empty(tmp))
+ if ((mutt_buffer_get_field(_("File under directory: "), tmp, MUTT_FILE | MUTT_CLEAR) != 0) ||
+ mutt_buffer_is_empty(tmp))
{
mutt_buffer_pool_release(&tmp);
return (-1);
mutt_buffer_strcpy(buf, NONULL(Context->pattern));
if (prompt || (op != MUTT_LIMIT))
{
- if ((mutt_get_field(prompt, buf->data, buf->dsize, MUTT_PATTERN | MUTT_CLEAR) != 0) ||
- !(mutt_b2s(buf)[0]))
+ if ((mutt_buffer_get_field(prompt, buf, MUTT_PATTERN | MUTT_CLEAR) != 0) ||
+ mutt_buffer_is_empty(buf))
{
mutt_buffer_pool_release(&buf);
return -1;
}
}
- mutt_buffer_fix_dptr(buf);
mutt_message(_("Compiling search pattern..."));
prompt = _("Save to file: ");
while (prompt)
{
- if (mutt_get_field(prompt, buf->data, buf->dsize, MUTT_FILE | MUTT_CLEAR) != 0)
+ if ((mutt_buffer_get_field(prompt, buf, MUTT_FILE | MUTT_CLEAR) != 0) ||
+ mutt_buffer_is_empty(buf))
{
- mutt_clear_error();
goto cleanup;
}
- mutt_buffer_fix_dptr(buf);
- if (mutt_buffer_is_empty(buf))
- goto cleanup;
prompt = NULL;
mutt_buffer_expand_path(buf);
mutt_buffer_strcpy(buf, mutt_path_basename(NONULL(top->filename)));
prepend_savedir(buf);
- if (mutt_get_field(_("Save to file: "), buf->data, buf->dsize,
- MUTT_FILE | MUTT_CLEAR) != 0)
+ if ((mutt_buffer_get_field(_("Save to file: "), buf, MUTT_FILE | MUTT_CLEAR) != 0) ||
+ mutt_buffer_is_empty(buf))
{
goto cleanup;
}
- mutt_buffer_fix_dptr(buf);
- if (mutt_buffer_is_empty(buf))
- goto cleanup;
mutt_buffer_expand_path(buf);
if (mutt_check_overwrite(top->filename, mutt_b2s(buf), tfile, &opt, NULL))
goto cleanup;
struct Address;
struct Body;
+struct Buffer;
struct Email;
struct Envelope;
struct Mailbox;
return -1;
}
+int mutt_buffer_get_field_full(const char *field, struct Buffer *buf, int complete,
+ bool multiple, char ***files, int *numfiles)
+{
+ return -1;
+}
+
int mutt_get_field_full(const char *field, char *buf, size_t buflen,
int complete, bool multiple, char ***files, int *numfiles)
{