pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
701 stars 163 forks source link

ignore quoted separators when splitting command lines #1458

Closed pacien closed 4 years ago

pacien commented 4 years ago

Fixes https://github.com/pazz/alot/issues/1454: Can't attach a file if filename contains a semicolon

mmartin commented 4 years ago

This seems not to work correctly, if there's an escaped quote inside the quotes.

This:

echo "foo; \"bar; baz";sleep 1

gets split into:

echo "foo; \"bar
 baz
sleep 1
pacien commented 4 years ago

I fixed the regexp and added a test for quoted escaped quotes.

pazz commented 4 years ago

I'm tempted to revert these changes in light of the newly introduced bugs: #1507 #1508

pacien commented 4 years ago

I'm not sure that I understand how those two issues relate to this changeset which only deals with the in-app command prompt input parsing.

pazz commented 4 years ago

Of course: you are right. I misunderstood the issue report and thought that the linked commit was responsible for a regression. All good :)