summaryrefslogtreecommitdiff
path: root/src/stty.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1992-11-12 02:19:02 +0000
committerJim Meyering <jim@meyering.net>1992-11-12 02:19:02 +0000
commit5fdea6164b1d94feb110fc85d50ddae5f9e0a1c3 (patch)
tree47efacff83691ac74016d5f1fdff507ffc46071a /src/stty.c
parent17387a999c446fab250321a02cbcb7774ec6c032 (diff)
downloadcoreutils-5fdea6164b1d94feb110fc85d50ddae5f9e0a1c3.tar.xz
(set_mode): Parenthesize expressions with bit operations
to correctly set/reset modes bits.
Diffstat (limited to 'src/stty.c')
-rw-r--r--src/stty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stty.c b/src/stty.c
index 7e27cac6f..f06a9759c 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -573,11 +573,12 @@ set_mode (info, reversed, mode)
{
if (reversed)
{
- mode->c_iflag = mode->c_iflag | ICRNL & ~INLCR & ~IGNCR;
- mode->c_oflag = mode->c_oflag
+ mode->c_iflag = (mode->c_iflag | ICRNL) & ~INLCR & ~IGNCR;
+ mode->c_oflag = (mode->c_oflag
#ifdef ONLCR
| ONLCR
#endif
+ )
#ifdef OCRNL
& ~OCRNL
#endif