diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-04-29 20:35:35 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-04-29 20:35:36 -0400 |
commit | ffc2844e9672ce4b2d9d2a4f6f676a46f64f4d09 (patch) | |
tree | e60721d1762d751f3ee27f24e78b4ee3f8006b0b /gdb | |
parent | 1207375d768ae2b901c3bea6543b610c461160dd (diff) | |
download | gdb-ffc2844e9672ce4b2d9d2a4f6f676a46f64f4d09.zip gdb-ffc2844e9672ce4b2d9d2a4f6f676a46f64f4d09.tar.gz gdb-ffc2844e9672ce4b2d9d2a4f6f676a46f64f4d09.tar.bz2 |
gdb: silence shellcheck warning SC2162 (use read -r) in gdbarch.sh
shellcheck reports:
In gdbarch.sh line 53:
while IFS='' read line
^--^ SC2162: read without -r will mangle backslashes.
See the rationale at [1]. In our case, we actually want the backslashes
to be interpreted and removed. Silence the warning using a directive.
[1] https://github.com/koalaman/shellcheck/wiki/SC2162
gdb/ChangeLog:
* gdbarch.sh (do_read): Add shellcheck disable directive for
warning SC2162.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rwxr-xr-x | gdb/gdbarch.sh | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index eb68416..830bc30 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2020-04-29 Simon Marchi <simon.marchi@efficios.com> + * gdbarch.sh (do_read): Add shellcheck disable directive for + warning SC2162. + +2020-04-29 Simon Marchi <simon.marchi@efficios.com> + * gdbarch.sh: Use ${foo:-} where shellcheck would report a "referenced but not assigned" warning. diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 24f8cdf..1377507 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -50,6 +50,7 @@ do_read () # On some SH's, 'read' trims leading and trailing whitespace by # default (e.g., bash), while on others (e.g., dash), it doesn't. # Set IFS to empty to disable the trimming everywhere. + # shellcheck disable=SC2162 while IFS='' read line do if test "${line}" = "" |