# This patch allows to specify files with spaces with the attach: header.
# see http://dev.mutt.org/trac/ticket/3179
|
old
|
new
|
|
| 152 | 152 | BODY *body; |
| 153 | 153 | BODY *parts; |
| 154 | 154 | char *q; |
| | 155 | int bs=0; |
| | 156 | int leng=0; |
| 155 | 157 | |
| 156 | 158 | p = cur->data + 7; |
| 157 | 159 | SKIPWS (p); |
| 158 | 160 | if (*p) |
| 159 | | { |
| 160 | | if ((q = strpbrk (p, " \t"))) |
| 161 | | { |
| 162 | | mutt_substrcpy (path, p, q, sizeof (path)); |
| 163 | | SKIPWS (q); |
| | 161 | { |
| | 162 | q=p; |
| | 163 | while (*p) { |
| | 164 | if (*p == '\\'){ |
| | 165 | bs=1; |
| | 166 | } |
| | 167 | if (isspace(*p)){ |
| | 168 | if (bs){ |
| | 169 | q--; |
| | 170 | *q = *p; |
| | 171 | p++; |
| | 172 | q++; |
| | 173 | bs = 0; |
| | 174 | continue; |
| | 175 | } |
| | 176 | else |
| | 177 | break; |
| | 178 | } |
| | 179 | *q = *p; |
| | 180 | q++; |
| | 181 | p++; |
| | 182 | leng++; |
| 164 | 183 | } |
| 165 | | else |
| 166 | | strfcpy (path, p, sizeof (path)); |
| | 184 | *q='\0' |
| | 185 | q-=leng; |
| | 186 | strfcpy (path, q, leng+1); |
| | 187 | SKIPWS (p); |
| | 188 | |
| 167 | 189 | mutt_expand_path (path, sizeof (path)); |
| 168 | 190 | if ((body = mutt_make_file_attach (path))) |
| 169 | 191 | { |
| 170 | | body->description = safe_strdup (q); |
| | 192 | body->description = safe_strdup (p); |
| 171 | 193 | for (parts = msg->content; parts->next; parts = parts->next) ; |
| 172 | 194 | parts->next = body; |
| 173 | 195 | } |