Anime4000 / IFME

Powerful x265 GUI Encoder
https://x265.github.io/
GNU General Public License v2.0
241 stars 54 forks source link

Folder or filename with a quote #81

Closed skrew closed 4 years ago

skrew commented 8 years ago

Hi,

On Linux, adding a folder or a filename with a quote cause a crash.

EG: L'univers

Anime4000 commented 8 years ago

have you try \" ?

skrew commented 8 years ago

I can't, i use it with the GUI application.

Anime4000 commented 8 years ago

this seem mono runtime limitation, wait... I trying on my VM

Anime4000 commented 8 years ago

If you using 6.0 error was: https://github.com/Anime4000/FFmpegDotNet/blob/master/FFmpegDotNet/Run.cs#L28

If you using 5.x issue was: https://github.com/Anime4000/IFME/blob/master/ifme/TaskManager.cs#L44

common problem: sh -c 'command here'

in windows, char " illegal, linux not, meanwhile ' both OS accept as file name... so...

skrew commented 8 years ago

Just to be clear, the crash come with a single quote: ' not double quote: "

Anime4000 commented 8 years ago

Yes, it crash because I instruct IFME to execute bash -c 'command' when file name has ' char, bash stop read at last ' char, rest of it consider other arguments, for example:

bash -c `echo "foobar"`

result: foobar

bash -c `echo "foo'bar"`

result: > waiting input, error

fix is:

bash -c "echo \"foo'bar\""

result: foo'bar

Linux very sensitive :cry: unlike Windows...

virtualbox_ubuntu 14 04 3 64-bit _28_01_2016_07_10_54

skrew commented 8 years ago

Hehe yep, but it's a bug resolved fast ! ;)

Anime4000 commented 8 years ago

and then... another better solution, using eval instead of bash -c or sh -c

hold on :smile:

Anime4000 commented 8 years ago

commit done! try recompile :smile: