rem: checkonly = 1;
add: checkonly = true;
context: main (int argc, char **argv){  struct keyfield *key;  struct keyfield gkey;  char const *s;  int c = 0;  int checkonly = 0, mergeonly = 0, nfiles = 0;  int posix_pedantic = (getenv ("POSIXLY_CORRECT") != NULL);  bool obsolete_usage = (posix2_version () < 200112);  char const *short_options = (obsolete_usage			       ? COMMON_SHORT_OPTIONS "y::"			       : COMMON_SHORT_OPTIONS "y:");  char *minus = "-", **files;  char const *outfile = minus;  static int const sigs[] = { SIGHUP, SIGINT, SIGPIPE, SIGTERM };  unsigned nsigs = sizeof sigs / sizeof *sigs;#ifdef SA_NOCLDSTOP  struct sigaction oldact, newact;#endif  program_name = argv[0];  setlocale (LC_ALL, "");  bindtextdomain (PACKAGE, LOCALEDIR);  textdomain (PACKAGE);  atexit (cleanup);  hard_LC_COLLATE = hard_locale (LC_COLLATE);#if HAVE_NL_LANGINFO  hard_LC_TIME = hard_locale (LC_TIME);#endif#if HAVE_SETLOCALE  /* Let's get locale's representation of the decimal point */  {    struct lconv *lconvp = localeconv ();    /* If the locale doesn't define a decimal point, or if the decimal       point is multibyte, use the C decimal point.  We don't support       multibyte decimal points yet.  */    decimal_point = *lconvp->decimal_point;    if (! decimal_point || lconvp->decimal_point[1])      decimal_point = C_DECIMAL_POINT;    /* We don't support multibyte thousands separators yet.  */    th_sep = *lconvp->thousands_sep;    if (! th_sep || lconvp->thousands_sep[1])      th_sep = CHAR_MAX + 1;  }#endif  have_read_stdin = 0;  inittables ();  /* Change the way library functions fail.  */  xalloc_exit_failure = SORT_FAILURE;  xmemcoll_exit_failure = SORT_FAILURE;#ifdef SA_NOCLDSTOP  {    unsigned i;    sigemptyset (&caught_signals);    for (i = 0; i < nsigs; i++)      sigaddset (&caught_signals, sigs[i]);    newact.sa_handler = sighandler;    newact.sa_mask = caught_signals;    newact.sa_flags = 0;  }#endif  {    unsigned i;    for (i = 0; i < nsigs; i++)      {	int sig = sigs[i];#ifdef SA_NOCLDSTOP	sigaction (sig, NULL, &oldact);	if (oldact.sa_handler != SIG_IGN)	  sigaction (sig, &newact, NULL);#else	if (signal (sig, SIG_IGN) != SIG_IGN)	  signal (sig, sighandler);#endif      }  }  gkey.sword = gkey.eword = -1;  gkey.ignore = NULL;  gkey.translate = NULL;  gkey.numeric = gkey.general_numeric = gkey.month = gkey.reverse = 0;  gkey.skipsblanks = gkey.skipeblanks = 0;  files = (char **) xmalloc (sizeof (char *) * argc);  for (;;)    {      /* Parse an operand as a file after "--" was seen; or if         pedantic and a file was seen, unless the POSIX version         predates 1003.1-2001 and -c was not seen and the operand is         "-o FILE" or "-oFILE".  */      if (c == -1	  || (posix_pedantic && nfiles != 0	      && ! (obsolete_usage		    && ! checkonly		    && optind != argc		    && argv[optind][0] == '-' && argv[optind][1] == 'o'		    && (argv[optind][2] || optind + 1 != argc)))	  || ((c = getopt_long (argc, argv, short_options,				long_options, NULL))	      == -1))	{	  if (optind == argc)	    break;	  files[nfiles++] = argv[optind++];	}      else switch (c)	{	case 1:	  key = NULL;	  if (obsolete_usage && optarg[0] == '+')	    {	      /* Treat +POS1 [-POS2] as a key if possible; but silently		 treat an operand as a file if it is not a valid +POS1.  */	      key = new_key ();	      s = parse_field_count (optarg + 1, &key->sword, NULL);	      if (s && *s == '.')		s = parse_field_count (s + 1, &key->schar, NULL);	      if (! (key->sword | key->schar))		key->sword = -1;	      if (! s || *set_ordering (s, key, bl_start))		{		  free (key);		  key = NULL;		}	      else		{		  if (optind != argc && argv[optind][0] == '-'		      && ISDIGIT (argv[optind][1]))		    {		      char const *optarg1 = argv[optind++];		      s = parse_field_count (optarg1 + 1, &key->eword,					     N_("invalid number after `-'"));		      if (*s == '.')			s = parse_field_count (s + 1, &key->echar,					       N_("invalid number after `.'"));		      if (*set_ordering (s, key, bl_end))			badfieldspec (optarg1,				      N_("stray character in field spec"));		    }		  insertkey (key);		}	    }	  if (! key)	    files[nfiles++] = optarg;	  break;	case 'b':	case 'd':	case 'f':	case 'g':	case 'i':	case 'M':	case 'n':	case 'r':	  {	    char str[2];	    str[0] = c;	    str[1] = '\0';	    set_ordering (str, &gkey, bl_both);	  }	  break;	case 'c':	  checkonly = 1;	  break;	case 'k':	  key = new_key ();	  /* Get POS1. */	  s = parse_field_count (optarg, &key->sword,				 N_("invalid number at field start"));	  if (! key->sword--)	    {	      /* Provoke with `sort -k0' */	      badfieldspec (optarg, N_("field number is zero"));	    }	  if (*s == '.')	    {	      s = parse_field_count (s + 1, &key->schar,				     N_("invalid number after `.'"));	      if (! key->schar--)		{		  /* Provoke with `sort -k1.0' */		  badfieldspec (optarg, N_("character offset is zero"));		}	    }	  if (! (key->sword | key->schar))	    key->sword = -1;	  s = set_ordering (s, key, bl_start);	  if (*s != ',')	    {	      key->eword = -1;	      key->echar = 0;	    }	  else	    {	      /* Get POS2. */	      s = parse_field_count (s + 1, &key->eword,				     N_("invalid number after `,'"));	      if (! key->eword--)		{		  /* Provoke with `sort -k1,0' */		  badfieldspec (optarg, N_("field number is zero"));		}	      if (*s == '.')		s = parse_field_count (s + 1, &key->echar,				       N_("invalid number after `.'"));	      else		{		  /* `-k 2,3' is equivalent to `+1 -3'.  */		  key->eword++;		}	      s = set_ordering (s, key, bl_end);	    }	  if (*s)	    badfieldspec (optarg, N_("stray character in field spec"));	  insertkey (key);	  break;	case 'm':	  mergeonly = 1;	  break;	case 'o':	  outfile = optarg;	  break;	case 's':	  stable = 1;	  break;	case 'S':	  specify_sort_size (optarg);	  break;	case 't':	  tab = optarg[0];	  if (tab && optarg[1])	    {	      /* Provoke with `sort -txx'.  Complain about		 "multi-character tab" instead of "multibyte tab", so		 that the diagnostic's wording does not need to be		 changed once multibyte characters are supported.  */	      error (SORT_FAILURE, 0, _("multi-character tab `%s'"), optarg);	    }	  break;	case 'T':	  add_temp_dir (optarg);	  break;	case 'u':	  unique = 1;	  break;	case 'y':	  /* Accept and ignore e.g. -y0 for compatibility with Solaris	     2.x through Solaris 7.  -y is marked as obsolete starting	     with Solaris 8.  */	  break;	case 'z':	  eolchar = 0;	  break;	case_GETOPT_HELP_CHAR;	case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);	default:	  usage (SORT_FAILURE);	}    }  /* Inheritance of global options to individual keys. */  for (key = keylist; key; key = key->next)    if (!key->ignore && !key->translate && !key->skipsblanks && !key->reverse	&& !key->skipeblanks && !key->month && !key->numeric	&& !key->general_numeric)      {	key->ignore = gkey.ignore;	key->translate = gkey.translate;	key->skipsblanks = gkey.skipsblanks;	key->skipeblanks = gkey.skipeblanks;	key->month = gkey.month;	key->numeric = gkey.numeric;	key->general_numeric = gkey.general_numeric;	key->reverse = gkey.reverse;      }  if (!keylist && (gkey.ignore || gkey.translate || gkey.skipsblanks		   || gkey.skipeblanks || gkey.month || gkey.numeric		   || gkey.general_numeric))    insertkey (&gkey);  reverse = gkey.reverse;  if (temp_dir_count == 0)    {      char const *tmp_dir = getenv ("TMPDIR");      add_temp_dir (tmp_dir ? tmp_dir : DEFAULT_TMPDIR);    }  if (nfiles == 0)    {      nfiles = 1;      files = &minus;    }  if (checkonly)    {      if (nfiles > 1)	error (SORT_FAILURE, 0, _("extra operand `%s' not allowed with -c"),	       files[1]);      /* POSIX requires that sort return 1 IFF invoked with -c and the	 input is not properly sorted.  */      exit (check (files, nfiles) == 0 ? EXIT_SUCCESS : SORT_OUT_OF_ORDER);    }  if (mergeonly)    {      int max_merge = first_same_file (files, MIN (nfiles, NMERGE), outfile);      merge (files, nfiles, max_merge, outfile);    }  else    sort (files, nfiles, outfile);  if (have_read_stdin && fclose (stdin) == EOF)    die (_("close failed"), "-");  exit (EXIT_SUCCESS);}