VirtualBox

Changeset 1281 in kBuild for trunk


Ignore:
Timestamp:
Nov 30, 2007 1:28:30 AM (17 years ago)
Author:
bird
Message:

docs, and separator alternatives.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk_redirect/kmk_redirect.c

    r1278 r1281  
    4747{
    4848    fprintf(pOut,
    49             "usage: %s [-[rwa+tb]<fd> <file>] -- <program> [args]\n"
     49            "usage: %s [-[rwa+tb]<fd>[=|:| ]<file>] -- <program> [args]\n"
    5050            "   or: %s --help\n"
    5151            "   or: %s --version\n"
    5252            "\n"
    5353            "The rwa+tb is like for fopen, if not specified it defaults to w+.\n"
    54             "The <fd> is either a number or an alias for the standard handles;\n"
    55             "i - stdin, o - stdout, e - stderr.\n"
     54            "The <fd> is either a number or an alias for the standard handles:\n"
     55            "   i = stdin\n"
     56            "   o = stdout\n"
     57            "   e = stderr\n"
     58            "\n"
     59            "This command is really just a quick hack to avoid invoking the shell\n"
     60            "on Windows (cygwin) where forking is very expensive and has exhibited\n"
     61            "stability issues on SMP machines. This tool may be retired when kBuild\n"
     62            "starts using the kmk_kash shell.\n"
    5663            ,
    5764            argv0, argv0, argv0);
     
    6875    FILE *pStdErr = stderr;
    6976    FILE *pStdOut = stdout;
    70 
    7177
    7278    /*
     
    245251            if (*psz)
    246252            {
    247                 fprintf(pStdErr, "%s: syntax error: characters following the file descriptor: '%s' ('%s')\n", argv[0], psz, argv[i]);
    248                 return 1;
    249             }
    250             i++;
    251             if (i >= argc )
    252             {
    253                 fprintf(pStdErr, "%s: syntax error: missing filename argument.\n", argv[0]);
    254                 return 1;
    255             }
    256             psz = argv[i];
     253                if (*psz != ':' && *psz != '=')
     254                {
     255                    fprintf(pStdErr, "%s: syntax error: characters following the file descriptor: '%s' ('%s')\n", argv[0], psz, argv[i]);
     256                    return 1;
     257                }
     258                psz++;
     259            }
     260            else
     261            {
     262                i++;
     263                if (i >= argc)
     264                {
     265                    fprintf(pStdErr, "%s: syntax error: missing filename argument.\n", argv[0]);
     266                    return 1;
     267                }
     268                psz = argv[i];
     269            }
    257270
    258271            /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette