ftilmann / latexdiff

Compares two latex files and marks up significant differences between them. Releases on www.ctan.org and mirrors
GNU General Public License v3.0
514 stars 72 forks source link

Fix issue #180 (--flatten fails on Windows) #181

Closed nbud closed 2 months ago

nbud commented 4 years ago

Fix for #180. The cd/tar line should have no impact on Linux. However I had to change the parsing of $options, I'm unsure about the consequences on Linux.

Windows cmd does not like escaping the options, which causes the invokation of latexdiff in line 490 to fail. Before the change of $options (fails on windows):

Running: latexdiff  '--flatten' "./latexdiff-vc-0c519c8/thesis.tex" "thesis.tex" > "thesis-diff0c519c8.tex"

After the change of $options (works on windows):

Running: latexdiff  --flatten "./latexdiff-vc-0c519c8/thesis.tex" "thesis.tex" > "thesis-diff0c519c8.tex"

Let me know what you think @ftilmann

ftilmann commented 4 years ago

Sorry for overlooking this for a long time. The change of cd .. ; tar to tar -C.. looks OK. If you can isolate that change I can easily merge it. The change in the options assembly will cause problems if the commands contain spaces or other symbols with specific meanings (in linux e.g &, >, <,\'(as they sometimes have to). In fact IIRC it was another patch that changed the command from the simple version you propose to the currently somewhat arcane nested quotations. I don't know Windows command line options but there must be a way to quote properly.

nbud commented 4 years ago

OK. I found the issue on $options you're mentioning: https://github.com/ftilmann/latexdiff/issues/58

I'll look for a way to escape it on both Windows and Linux.

ftilmann commented 2 months ago

Closing as no activity > 1 yr and unresolved issues