aurora / rmate

Remote TextMate 2 implemented as shell script
GNU General Public License v3.0
887 stars 123 forks source link

resolve shellcheck SC2162: read without -r will mangle backslashes #56

Closed mobilemind closed 7 years ago

mobilemind commented 7 years ago

Though it seems unlikely something like "hostname" would have backslash-escaped characters, shellcheck warns that rmate uses "read without -r" in 3 places. This PR includes the recommended change in all 4 places.

Note that $ help read indicates:

If the -r option is given, this signifies `raw' input, and backslash escaping is disabled.

The read -r option might not be what rmate needs, in any (or all) cases.

The snippet below shows the issues as reported by shellcheck v 0.4.6.

shellcheck rmate | grep -F -B 4 'SC2162'

In rmate line 70:
        while read row; do
              ^-- SC2162: read without -r will mangle backslashes.
--
In rmate line 316:
    while read 0<&3; do
          ^-- SC2162: read without -r will mangle backslashes.
--
In rmate line 325:
        while read 0<&3; do
              ^-- SC2162: read without -r will mangle backslashes.
--
In rmate line 382:
read server_info 0<&3
^-- SC2162: read without -r will mangle backslashes.
aurora commented 7 years ago

Thanks!