aboutsummaryrefslogtreecommitdiff
path: root/coreutils/stty.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-01 18:18:04 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-01 18:18:04 +0000
commitb2abef3e54de606ced5082d82e381dbafef1bf72 (patch)
tree9082c2b4d0091f108432b2a41b7ee33152c9240f /coreutils/stty.c
parente27f15615f93065265209e26ff07cf9b4ae8658c (diff)
downloadbusybox-w32-b2abef3e54de606ced5082d82e381dbafef1bf72.tar.gz
busybox-w32-b2abef3e54de606ced5082d82e381dbafef1bf72.tar.bz2
busybox-w32-b2abef3e54de606ced5082d82e381dbafef1bf72.zip
stty: fix width of a field for ppc32
sort: fix -u to match coreutils 6.3 msh: compile fix (my fault)
Diffstat (limited to 'coreutils/stty.c')
-rw-r--r--coreutils/stty.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c
index 22784a260..b48941429 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -158,13 +158,18 @@ static const char stty_dec [] = "dec";
158 158
159/* Each mode */ 159/* Each mode */
160struct mode_info { 160struct mode_info {
161 const char *name; /* Name given on command line */ 161 const char *name; /* Name given on command line */
162 char type; /* Which structure element to change */ 162 char type; /* Which structure element to change */
163 char flags; /* Setting and display options */ 163 char flags; /* Setting and display options */
164 unsigned short mask; /* Other bits to turn off for this mode */ 164 /* were using short here, but ppc32 was unhappy: */
165 unsigned long bits; /* Bits to set for this mode */ 165 tcflag_t mask; /* Other bits to turn off for this mode */
166 tcflag_t bits; /* Bits to set for this mode */
166}; 167};
167 168
169/* We can optimize it further by using name[8] instead of char *name */
170/* but beware of "if (info->name == evenp)" checks! */
171/* Need to replace them with "if (info == &mode_info[EVENP_INDX])" */
172
168#define MI_ENTRY(N,T,F,B,M) { N, T, F, M, B } 173#define MI_ENTRY(N,T,F,B,M) { N, T, F, M, B }
169 174
170static const struct mode_info mode_info[] = { 175static const struct mode_info mode_info[] = {
@@ -319,9 +324,9 @@ enum {
319 324
320/* Control character settings */ 325/* Control character settings */
321struct control_info { 326struct control_info {
322 const char *name; /* Name given on command line */ 327 const char *name; /* Name given on command line */
323 unsigned char saneval; /* Value to set for 'stty sane' */ 328 unsigned char saneval; /* Value to set for 'stty sane' */
324 unsigned char offset; /* Offset in c_cc */ 329 unsigned char offset; /* Offset in c_cc */
325}; 330};
326 331
327/* Control characters */ 332/* Control characters */
@@ -968,9 +973,9 @@ static void set_mode(const struct mode_info *info, int reversed,
968 973
969 if (bitsp) { 974 if (bitsp) {
970 if (reversed) 975 if (reversed)
971 *bitsp = *bitsp & ~((unsigned long)info->mask) & ~info->bits; 976 *bitsp = *bitsp & ~info->mask & ~info->bits;
972 else 977 else
973 *bitsp = (*bitsp & ~((unsigned long)info->mask)) | info->bits; 978 *bitsp = (*bitsp & ~info->mask) | info->bits;
974 return; 979 return;
975 } 980 }
976 981