rem: else if (STREQ (argv[k], "speed"))
add: else if (STREQ (arg, "speed"))
context: main (int argc, char **argv){  struct termios mode;  enum output_type output_type;  int optc;  int require_set_attr;  int speed_was_set;  int verbose_output;  int recoverable_output;  int k;  int noargs = 1;  char *file_name = NULL;  int fd;  const char *device_name;  const char *posixly_correct = getenv ("POSIXLY_CORRECT");  int invalid_long_option = 0;  program_name = argv[0];  setlocale (LC_ALL, "");  bindtextdomain (PACKAGE, LOCALEDIR);  textdomain (PACKAGE);  atexit (close_stdout);  parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,		      AUTHORS, usage);  output_type = changed;  verbose_output = 0;  recoverable_output = 0;  /* Don't print error messages for unrecognized options.  */  opterr = 0;  while ((optc = getopt_long (argc, argv, "agF:", longopts, NULL)) != -1)    {      int unrecognized_option = 0;      switch (optc)	{	case 'a':	  verbose_output = 1;	  output_type = all;	  break;	case 'g':	  recoverable_output = 1;	  output_type = recoverable;	  break;	case 'F':	  if (file_name)	    error (2, 0, _("only one device may be specified"));	  file_name = optarg;	  break;	default:	  unrecognized_option = 1;	  break;	}      if (unrecognized_option)	break;    }  /* FIXME: what is this?!? */  if (invalid_long_option)    usage (EXIT_FAILURE);  /* Clear out the options that have been parsed.  This is really     gross, but it's needed because stty SETTINGS look like options to     getopt(), so we need to work around things in a really horrible     way.  If any new options are ever added to stty, the short option     MUST NOT be a letter which is the first letter of one of the     possible stty settings.  If you change anything about how stty     parses options, be sure it still works with combinations of     short and long options, --, POSIXLY_CORRECT, etc.  */  for (k = 1; k < argc; k++)    {      size_t len;      char *eq;      if (argv[k] == NULL)	continue;      /* Handle --, and reset noargs if there are arguments following it.  */      if (STREQ (argv[k], "--"))	{	  argv[k] = NULL;	  if (k < argc - 1)	    noargs = 0;	  break;    	}      /* Handle "--file device" */      len = strlen (argv[k]);      if (len >= 3 && strstr ("--file", argv[k]))	{	  argv[k] = NULL;	  argv[k + 1] = NULL;	  continue;    	}      /* Handle "--all" and "--save".  */      if (len >= 3	  && (strstr ("--all", argv[k])	      || strstr ("--save", argv[k])))	{	  argv[k] = NULL;	  continue;	}      /* Handle "--file=device".  */      eq = strchr (argv[k], '=');      if (eq && eq - argv[k] >= 3)	{	  *eq = '\0';	  if (strstr ("--file", argv[k]))	    {	      argv[k] = NULL;	      continue;	    }	  /* Put the equals sign back for the error message.  */	  *eq = '=';	}      /* Handle "-a", "-ag", "-aF/dev/foo", "-aF /dev/foo", etc.  */      if (valid_options (argv[k], "ag", "F"))	{	  /* FIXME: this loses when the device name ends in `F'.	     e.g. `stty -F/dev/BARF nl' would clobber the `nl' argument.  */	  if (argv[k][strlen (argv[k]) - 1] == 'F')	    argv[k + 1] = NULL;	  argv[k] = NULL;        }      /* Everything else must be a normal, non-option argument.  */      else	{	  noargs = 0;	  if (posixly_correct)	    break;        }    }  /* Specifying both -a and -g gets an error.  */  if (verbose_output && recoverable_output)    error (2, 0,	   _("the options for verbose and stty-readable output styles are\n\mutually exclusive"));  /* Specifying any other arguments with -a or -g gets an error.  */  if (!noargs && (verbose_output || recoverable_output))    error (2, 0, _("when specifying an output style, modes may not be set"));  /* FIXME: it'd be better not to open the file until we've verified     that all arguments are valid.  Otherwise, we could end up doing     only some of the requested operations and then failing, probably     leaving things in an undesirable state.  */  if (file_name)    {      int fdflags;      device_name = file_name;      fd = open (device_name, O_RDONLY | O_NONBLOCK);      if (fd < 0)	error (EXIT_FAILURE, errno, "%s", device_name);      if ((fdflags = fcntl (fd, F_GETFL)) == -1	  || fcntl (fd, F_SETFL, fdflags & ~O_NONBLOCK) < 0)	error (EXIT_FAILURE, errno, _("%s: couldn't reset non-blocking mode"),	       device_name);    }  else    {      fd = 0;      device_name = _("standard input");    }  /* Initialize to all zeroes so there is no risk memcmp will report a     spurious difference in an uninitialized portion of the structure.  */  memset (&mode, 0, sizeof (mode));  if (tcgetattr (fd, &mode))    error (EXIT_FAILURE, errno, "%s", device_name);  if (verbose_output || recoverable_output || noargs)    {      max_col = screen_columns ();      current_col = 0;      display_settings (output_type, &mode, fd, device_name);      exit (EXIT_SUCCESS);    }  speed_was_set = 0;  require_set_attr = 0;  k = 1;  while (k < argc)    {      int match_found = 0;      int reversed = 0;      int i;      if (argv[k] == 0)	{	  k++;	  continue;	}      if (argv[k][0] == '-')	{	  ++argv[k];	  reversed = 1;	}      for (i = 0; mode_info[i].name != NULL; ++i)	{	  if (STREQ (argv[k], mode_info[i].name))	    {	      match_found = set_mode (&mode_info[i], reversed, &mode);	      require_set_attr = 1;	      break;	    }	}      if (match_found == 0 && reversed)	{	  error (0, 0, _("invalid argument `%s'"), --argv[k]);	  usage (EXIT_FAILURE);	}      if (match_found == 0)	{	  for (i = 0; control_info[i].name != NULL; ++i)	    {	      if (STREQ (argv[k], control_info[i].name))		{		  if (k == argc - 1)		    {		      error (0, 0, _("missing argument to `%s'"), argv[k]);		      usage (EXIT_FAILURE);		    }		  match_found = 1;		  ++k;		  set_control_char (&control_info[i], argv[k], &mode);		  require_set_attr = 1;		  break;		}	    }	}      if (match_found == 0)	{	  if (STREQ (argv[k], "ispeed"))	    {	      if (k == argc - 1)		{		  error (0, 0, _("missing argument to `%s'"), argv[k]);		  usage (EXIT_FAILURE);		}	      ++k;	      set_speed (input_speed, argv[k], &mode);	      speed_was_set = 1;	      require_set_attr = 1;	    }	  else if (STREQ (argv[k], "ospeed"))	    {	      if (k == argc - 1)		{		  error (0, 0, _("missing argument to `%s'"), argv[k]);		  usage (EXIT_FAILURE);		}	      ++k;	      set_speed (output_speed, argv[k], &mode);	      speed_was_set = 1;	      require_set_attr = 1;	    }#ifdef TIOCGWINSZ	  else if (STREQ (argv[k], "rows"))	    {	      if (k == argc - 1)		{		  error (0, 0, _("missing argument to `%s'"), argv[k]);		  usage (EXIT_FAILURE);		}	      ++k;	      set_window_size ((int) integer_arg (argv[k]), -1,			       fd, device_name);	    }	  else if (STREQ (argv[k], "cols")		   || STREQ (argv[k], "columns"))	    {	      if (k == argc - 1)		{		  error (0, 0, _("missing argument to `%s'"), argv[k]);		  usage (EXIT_FAILURE);		}	      ++k;	      set_window_size (-1, (int) integer_arg (argv[k]),			       fd, device_name);	    }	  else if (STREQ (argv[k], "size"))	    {	      max_col = screen_columns ();	      current_col = 0;	      display_window_size (0, fd, device_name);	    }#endif#ifdef HAVE_C_LINE	  else if (STREQ (argv[k], "line"))	    {	      if (k == argc - 1)		{		  error (0, 0, _("missing argument to `%s'"), argv[k]);		  usage (EXIT_FAILURE);		}	      ++k;	      mode.c_line = integer_arg (argv[k]);	      require_set_attr = 1;	    }#endif	  else if (STREQ (argv[k], "speed"))	    {	      max_col = screen_columns ();	      display_speed (&mode, 0);	    }	  else if (string_to_baud (argv[k]) != (speed_t) -1)	    {	      set_speed (both_speeds, argv[k], &mode);	      speed_was_set = 1;	      require_set_attr = 1;	    }	  else	    {	      if (recover_mode (argv[k], &mode) == 0)		{		  error (0, 0, _("invalid argument `%s'"), argv[k]);		  usage (EXIT_FAILURE);		}	      require_set_attr = 1;	    }	}      k++;    }  if (require_set_attr)    {      struct termios new_mode;      if (tcsetattr (fd, TCSADRAIN, &mode))	error (EXIT_FAILURE, errno, "%s", device_name);      /* POSIX (according to Zlotnick's book) tcsetattr returns zero if	 it performs *any* of the requested operations.  This means it	 can report `success' when it has actually failed to perform	 some proper subset of the requested operations.  To detect	 this partial failure, get the current terminal attributes and	 compare them to the requested ones.  */      /* Initialize to all zeroes so there is no risk memcmp will report a	 spurious difference in an uninitialized portion of the structure.  */      memset (&new_mode, 0, sizeof (new_mode));      if (tcgetattr (fd, &new_mode))	error (EXIT_FAILURE, errno, "%s", device_name);      /* Normally, one shouldn't use memcmp to compare structures that	 may have `holes' containing uninitialized data, but we have been	 careful to initialize the storage of these two variables to all	 zeroes.  One might think it more efficient simply to compare the	 modified fields, but that would require enumerating those fields --	 and not all systems have the same fields in this structure.  */      if (memcmp (&mode, &new_mode, sizeof (mode)) != 0)	{#ifdef CIBAUD	  /* SunOS 4.1.3 (at least) has the problem that after this sequence,	     tcgetattr (&m1); tcsetattr (&m1); tcgetattr (&m2);	     sometimes (m1 != m2).  The only difference is in the four bits	     of the c_cflag field corresponding to the baud rate.  To save	     Sun users a little confusion, don't report an error if this	     happens.  But suppress the error only if we haven't tried to	     set the baud rate explicitly -- otherwise we'd never give an	     error for a true failure to set the baud rate.  */	  new_mode.c_cflag &= (~CIBAUD);	  if (speed_was_set || memcmp (&mode, &new_mode, sizeof (mode)) != 0)#endif	    {	      error (EXIT_FAILURE, 0,		     _("%s: unable to perform all requested operations"),		     device_name);#ifdef TESTING	      {		size_t i;		printf (_("new_mode: mode\n"));		for (i = 0; i < sizeof (new_mode); i++)		  printf ("0x%02x: 0x%02x\n",			  *(((unsigned char *) &new_mode) + i),			  *(((unsigned char *) &mode) + i));	      }#endif	    }	}    }  exit (EXIT_SUCCESS);}