}
int _mutt_get_field (const char *field, char *buf, size_t buflen, int complete, int multiple, char ***files, int *numfiles)
+{
+ BUFFER *buffer;
+ int rc;
+
+ buffer = mutt_buffer_pool_get ();
+
+ mutt_buffer_addstr (buffer, buf);
+ rc = _mutt_buffer_get_field (field, buffer, complete, multiple, files, numfiles);
+ strfcpy (buf, mutt_b2s (buffer), buflen);
+
+ mutt_buffer_pool_release (&buffer);
+ return rc;
+}
+
+int _mutt_buffer_get_field (const char *field, BUFFER *buffer, int complete, int multiple, char ***files, int *numfiles)
{
int ret;
int x;
NORMAL_COLOR;
mutt_refresh ();
mutt_window_getyx (MuttMessageWindow, NULL, &x);
- ret = _mutt_enter_string (buf, buflen, x, complete, multiple, files, numfiles, es);
+ ret = _mutt_enter_string (buffer->data, buffer->dsize, x, complete, multiple, files, numfiles, es);
}
while (ret == 1);
+
+ if (ret != 0)
+ mutt_buffer_clear (buffer);
+ else
+ mutt_buffer_fix_dptr (buffer);
+
mutt_window_clearline (MuttMessageWindow, 0);
mutt_free_enter_state (&es);
int _mutt_enter_string (char *, size_t, int, int, int, char ***, int *, ENTER_STATE *);
#define mutt_get_field(A,B,C,D) _mutt_get_field(A,B,C,D,0,NULL,NULL)
int _mutt_get_field (const char *, char *, size_t, int, int, char ***, int *);
+#define mutt_buffer_get_field(A,B,C) _mutt_buffer_get_field(A,B,C,0,NULL,NULL)
+int _mutt_buffer_get_field (const char *, BUFFER *, int, int, char ***, int *);
int mutt_get_hook_type (const char *);
int mutt_get_field_unbuffered (char *, char *, size_t, int);
#define mutt_get_password(A,B,C) mutt_get_field_unbuffered(A,B,C,MUTT_PASS)