Skip to content

Commit

Permalink
astextplain: pass non-word .doc files through again
Browse files Browse the repository at this point in the history
Commit a45f9aba (textconv: Pass through non-MS-Word *.doc files, 2011-03-31) in
msysgit/msysgit introduced a way to pass files that antiword doesn't recognize
(likely plaintext files) to the caller of the textconv unmodified. When we imported
The file for Git for Windows version 2 we added a call to sed that broke this bypass.

Restore this feature and actually check for the antiword exit code again. As a bonus,
this allows us to only invoke sed if atiword succeeded.

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
  • Loading branch information
rimrul authored and dscho committed Feb 1, 2022
1 parent e97e918 commit 5602f36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion git-extra/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ sha256sums=('8ed76d1cb069ac8568f21c431f5e23caebea502d932ab4cdff71396f4f0d5b72'
'dcbd1b981d5b899afe30151a5f5a27ea52025ff1335f131af1b5891f62ddd55b'
'683ab066be19cb4defec470ebd53f165ca5dbf761fd40c13aee8abe31ba42803'
'1cf2c13fb97c51375a76ed479362c3cbcdb51ab4d3a745e8d2c3a780badd8d46'
'37e3412480f0fc5b742406d569baa1a6c572f5be16650ae70c65169c5fd4a8e3'
'ccd0f6a92335b226079b99aa6180e256ceeb771caadf666728b838e6d13ef184'
'7db260f31f9d31cfb7bcc76f379272e4e4b9fc0890e62adef8bf2cb624f6e296'
'22f41610dea842890955032af30efdb60e80f310e95a04e57ab36b10e0376923'
'5fe1fdce2f3c4b8dc2d026f3b8f000925c82e39655aea4e37d543862269d0732'
Expand Down
2 changes: 1 addition & 1 deletion git-extra/astextplain
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ case "$1" in
odt2txt "$1" || cat "$1"
;;
*.doc | *.DOC | *.dot | *.DOT)
antiword -m UTF-8 "$1" | sed "s/\^M$//" || cat "$1"
out=$(antiword -m UTF-8 "$1") && sed "s/\^M$//" <<<$out || cat "$1"
;;
*.docx | *.DOCX | *.dotx | *.DOTX | *.docm | *.DOCM | *.dotm | *.DOTM)
docx2txt.pl "$1" -
Expand Down

0 comments on commit 5602f36

Please sign in to comment.