+#define QUOTE_IF_REQUIRED(out, str) \
+{ \
+ if (*str != '"' && strchr(str, ' ')) { \
+ gint len; \
+ len = strlen(str) + 3; \
+ Xalloca(out, len, return IMAP_ERROR); \
+ g_snprintf(out, len, "\"%s\"", str); \
+ } else { \
+ Xstrdup_a(out, str, return IMAP_ERROR); \
+ } \
+}
+