Ignore:
Timestamp:
Mar 14, 2018, 10:28:10 PM (7 years ago)
Author:
bird
Message:

kmk: Merged in changes from GNU make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6 / https://git.savannah.gnu.org/git/make.git).

Location:
trunk/src/kmk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk

  • trunk/src/kmk/getopt.c

    r2591 r3140  
    44before changing it!
    55
    6 Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
    7 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
    8 2010 Free Software Foundation, Inc.
     6Copyright (C) 1987-2016 Free Software Foundation, Inc.
    97
    108NOTE: The canonical source of this file is maintained with the GNU C Library.
     
    8482
    8583
    86 /* This version of `getopt' appears to the caller like standard Unix `getopt'
     84/* This version of `getopt' appears to the caller like standard Unix 'getopt'
    8785   but it behaves differently for the user, since it allows the user
    8886   to intersperse the options with the other arguments.
     
    202200# endif
    203201
     202#ifndef KMK
    204203/* Avoid depending on library functions or files
    205204   whose names are inconsistent.  */
    206 
    207205#ifndef getenv
    208206extern char *getenv ();
    209207#endif
     208#endif /* !KMK */
    210209
    211210static char *
     
    662661        {
    663662          if (opterr)
    664             fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
     663            fprintf (stderr, _("%s: option '%s' is ambiguous\n"),
    665664                     argv[0], argv[optind]);
    666665          nextchar += strlen (nextchar);
     
    683682                {
    684683                  if (opterr)
    685                     {
    686                       if (argv[optind - 1][1] == '-')
    687                         /* --option */
    688                         fprintf (stderr,
    689                          _("%s: option `--%s' doesn't allow an argument\n"),
    690                          argv[0], pfound->name);
    691                       else
    692                         /* +option or -option */
    693                         fprintf (stderr,
    694                          _("%s: option `%c%s' doesn't allow an argument\n"),
    695                          argv[0], argv[optind - 1][0], pfound->name);
    696                     }
     684                  { /* bird: disambiguate */
     685                   if (argv[optind - 1][1] == '-')
     686                    /* --option */
     687                    fprintf (stderr,
     688                     _("%s: option '--%s' doesn't allow an argument\n"),
     689                     argv[0], pfound->name);
     690                   else
     691                    /* +option or -option */
     692                    fprintf (stderr,
     693                     _("%s: option '%c%s' doesn't allow an argument\n"),
     694                     argv[0], argv[optind - 1][0], pfound->name);
     695                  }
    697696
    698697                  nextchar += strlen (nextchar);
     
    710709                  if (opterr)
    711710                    fprintf (stderr,
    712                            _("%s: option `%s' requires an argument\n"),
     711                           _("%s: option '%s' requires an argument\n"),
    713712                           argv[0], argv[optind - 1]);
    714713                  nextchar += strlen (nextchar);
     
    739738              if (argv[optind][1] == '-')
    740739                /* --option */
    741                 fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
     740                fprintf (stderr, _("%s: unrecognized option '--%s'\n"),
    742741                         argv[0], nextchar);
    743742              else
    744743                /* +option or -option */
    745                 fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
     744                fprintf (stderr, _("%s: unrecognized option '%c%s'\n"),
    746745                         argv[0], argv[optind][0], nextchar);
    747746            }
     
    849848          {
    850849            if (opterr)
    851               fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
     850              fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"),
    852851                       argv[0], argv[optind]);
    853852            nextchar += strlen (nextchar);
     
    868867                    if (opterr)
    869868                      fprintf (stderr, _("\
    870 %s: option `-W %s' doesn't allow an argument\n"),
     869%s: option '-W %s' doesn't allow an argument\n"),
    871870                               argv[0], pfound->name);
    872871
     
    883882                    if (opterr)
    884883                      fprintf (stderr,
    885                                _("%s: option `%s' requires an argument\n"),
     884                               _("%s: option '%s' requires an argument\n"),
    886885                               argv[0], argv[optind - 1]);
    887886                    nextchar += strlen (nextchar);
     
    10101009
    10111010        case 'c':
    1012           printf ("option c with value `%s'\n", optarg);
     1011          printf ("option c with value '%s'\n", optarg);
    10131012          break;
    10141013
Note: See TracChangeset for help on using the changeset viewer.