home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume22 / parseargs / patch08 / PATCH08
Encoding:
Text File  |  1991-08-16  |  53.2 KB  |  1,923 lines

  1. *** Intro.OLD    Thu Aug 15 11:46:15 1991
  2. --- Intro    Thu Aug 15 11:05:23 1991
  3. ***************
  4. *** 98,104 ****
  5.   
  6.    The VMS command-line syntax would be the following:
  7.   
  8. !     cmdname [/AREA[=<areacode>]] [/GROUPS=<newsgroups>[,<newsgroups>...]
  9.               [/REP=<repcount>] [/SEP=<sepchar>] [/X]  <name>
  10.               [<args>[,<args>...]]
  11.   
  12. --- 98,104 ----
  13.   
  14.    The VMS command-line syntax would be the following:
  15.   
  16. !     cmdname [/AREA[=<areacode>]] [/GROUPS=<newsgroups>[,<newsgroups>...]]
  17.               [/REP=<repcount>] [/SEP=<sepchar>] [/X]  <name>
  18.               [<args>[,<args>...]]
  19.   
  20. *** README.OLD    Thu Aug 15 11:46:40 1991
  21. --- README    Thu Aug 15 11:06:56 1991
  22. ***************
  23. *** 222,229 ****
  24.   
  25.   
  26.                Update to parseargs (and major re-write) by Brad Appleton
  27. !                         (brad@travis.ssd.csd.harris.com)
  28. !                               Last Update: 04/12/91
  29.    
  30.   
  31.    THIS RELEASE
  32. --- 222,229 ----
  33.   
  34.   
  35.                Update to parseargs (and major re-write) by Brad Appleton
  36. !                         (brad@ssd.csd.harris.com)
  37. !                               Last Update: 08/15/91
  38.    
  39.   
  40.    THIS RELEASE
  41. *** amiga_args.c.OLD    Thu Aug 15 11:46:47 1991
  42. --- amiga_args.c    Thu Aug  1 15:45:49 1991
  43. ***************
  44. *** 69,75 ****
  45.   ** ^REQUIREMENTS:
  46.   **    The final element in argv must be a NULL pointer.
  47.   **
  48. ! ** ^SIDE-EFECTS:
  49.   **    argd is modified according to the command-line description and parameters
  50.   **
  51.   ** ^RETURN-VALUE:
  52. --- 69,75 ----
  53.   ** ^REQUIREMENTS:
  54.   **    The final element in argv must be a NULL pointer.
  55.   **
  56. ! ** ^SIDE-EFFECTS:
  57.   **    argd is modified according to the command-line description and parameters
  58.   **
  59.   ** ^RETURN-VALUE:
  60. ***************
  61. *** 347,353 ****
  62.   **    buf must be large enough to hold the formatted result (100 characters
  63.   **    should do the trick).
  64.   **
  65. ! ** ^SIDE-EFECTS:
  66.   **    buf is overwritten.
  67.   **
  68.   ** ^RETURN-VALUE:
  69. --- 347,353 ----
  70.   **    buf must be large enough to hold the formatted result (100 characters
  71.   **    should do the trick).
  72.   **
  73. ! ** ^SIDE-EFFECTS:
  74.   **    buf is overwritten.
  75.   **
  76.   ** ^RETURN-VALUE:
  77. ***************
  78. *** 415,421 ****
  79.   ** ^REQUIREMENTS:
  80.   **    argd should be a non-null command-line argument-descriptor array
  81.   **
  82. ! ** ^SIDE-EFECTS:
  83.   **    Prints on stderr.
  84.   **
  85.   ** ^RETURN-VALUE:
  86. --- 415,421 ----
  87.   ** ^REQUIREMENTS:
  88.   **    argd should be a non-null command-line argument-descriptor array
  89.   **
  90. ! ** ^SIDE-EFFECTS:
  91.   **    Prints on stderr.
  92.   **
  93.   ** ^RETURN-VALUE:
  94. *** arglist.c.OLD    Thu Aug 15 11:46:54 1991
  95. --- arglist.c    Thu Aug  1 15:45:54 1991
  96. ***************
  97. *** 61,67 ****
  98.   **    string-list argument. The ad_valp field of ad MUST be either NULL or
  99.   **    point to a valid arglist-head structure.
  100.   **
  101. ! ** ^SIDE-EFECTS:
  102.   **    If successful, arglist pointed to by arg_valp(ad) is appended with
  103.   **    the given string, <vp> is unchanged.
  104.   **
  105. --- 61,67 ----
  106.   **    string-list argument. The ad_valp field of ad MUST be either NULL or
  107.   **    point to a valid arglist-head structure.
  108.   **
  109. ! ** ^SIDE-EFFECTS:
  110.   **    If successful, arglist pointed to by arg_valp(ad) is appended with
  111.   **    the given string, <vp> is unchanged.
  112.   **
  113. ***************
  114. *** 174,180 ****
  115.   ** ^REQUIREMENTS:
  116.   **    argls must point to a valid arglist-head structure.
  117.   **
  118. ! ** ^SIDE-EFECTS:
  119.   **    each item in argls is removed, argls itself should be set to NULL
  120.   **    after this routine is invoked.
  121.   **
  122. --- 174,180 ----
  123.   ** ^REQUIREMENTS:
  124.   **    argls must point to a valid arglist-head structure.
  125.   **
  126. ! ** ^SIDE-EFFECTS:
  127.   **    each item in argls is removed, argls itself should be set to NULL
  128.   **    after this routine is invoked.
  129.   **
  130. *** ibm_args.c.OLD    Thu Aug 15 11:50:11 1991
  131. --- ibm_args.c    Thu Aug  1 15:46:01 1991
  132. ***************
  133. *** 97,103 ****
  134.   ** ^REQUIREMENTS:
  135.   **    None.
  136.   **
  137. ! ** ^SIDE-EFECTS:
  138.   **    Sets the global variables "OptPrefix" and "KwdPrefix'.
  139.   **
  140.   ** ^RETURN-VALUE:
  141. --- 97,103 ----
  142.   ** ^REQUIREMENTS:
  143.   **    None.
  144.   **
  145. ! ** ^SIDE-EFFECTS:
  146.   **    Sets the global variables "OptPrefix" and "KwdPrefix'.
  147.   **
  148.   ** ^RETURN-VALUE:
  149. ***************
  150. *** 162,168 ****
  151.   ** ^REQUIREMENTS:
  152.   **    The final element in argv must be a NULL pointer.
  153.   **
  154. ! ** ^SIDE-EFECTS:
  155.   **    argd is modified according to the command-line description and parameters
  156.   **
  157.   ** ^RETURN-VALUE:
  158. --- 162,168 ----
  159.   ** ^REQUIREMENTS:
  160.   **    The final element in argv must be a NULL pointer.
  161.   **
  162. ! ** ^SIDE-EFFECTS:
  163.   **    argd is modified according to the command-line description and parameters
  164.   **
  165.   ** ^RETURN-VALUE:
  166. ***************
  167. *** 564,570 ****
  168.   **    buf must be large enough to hold the formatted result (100 characters
  169.   **    should do the trick).
  170.   **
  171. ! ** ^SIDE-EFECTS:
  172.   **    buf is overwritten.
  173.   **
  174.   ** ^RETURN-VALUE:
  175. --- 564,570 ----
  176.   **    buf must be large enough to hold the formatted result (100 characters
  177.   **    should do the trick).
  178.   **
  179. ! ** ^SIDE-EFFECTS:
  180.   **    buf is overwritten.
  181.   **
  182.   ** ^RETURN-VALUE:
  183. ***************
  184. *** 658,664 ****
  185.   ** ^REQUIREMENTS:
  186.   **    argd should be a non-null command-line argument-descriptor array
  187.   **
  188. ! ** ^SIDE-EFECTS:
  189.   **    Prints on stderr.
  190.   **
  191.   ** ^RETURN-VALUE:
  192. --- 658,664 ----
  193.   ** ^REQUIREMENTS:
  194.   **    argd should be a non-null command-line argument-descriptor array
  195.   **
  196. ! ** ^SIDE-EFFECTS:
  197.   **    Prints on stderr.
  198.   **
  199.   ** ^RETURN-VALUE:
  200. *** parseargs.c.OLD    Thu Aug 15 11:50:26 1991
  201. --- parseargs.c    Thu Aug 15 10:56:52 1991
  202. ***************
  203. *** 244,256 ****
  204.      /* array of shell info records for supported shells */
  205.   static CONST shell_info  Shell[] = {
  206.      {
  207.         SH,  "sh",
  208. !       "shift $#;\n",  
  209.         "%s=",  "'",  "';\n",
  210.         "%s=",  "'",  "'%s'",  "';\n",
  211. !       "'\\%c'",  "'"
  212.      },
  213.      {
  214.         BASH,  "bash",
  215.         "shift $#;\n",  
  216.         "%s=",  "'",  "';\n",
  217. --- 244,270 ----
  218.      /* array of shell info records for supported shells */
  219.   static CONST shell_info  Shell[] = {
  220.      {
  221. +          /* Bourne Shell */
  222.         SH,  "sh",
  223. !          /* "shift $#" unsets the positional parameters */
  224. !       "shift $#;\n",
  225. !          /* "name='value'" assigns "value" to the variable "name" */
  226.         "%s=",  "'",  "';\n",
  227. +          /* "ary='elt1 elt2 ...'" assigns an array named "ary" */
  228.         "%s=",  "'",  "'%s'",  "';\n",
  229. !          /* the only character we need to escape is a "'", We do this by ending
  230. !          ** the current quote, escaping the quote, and starting a new one
  231. !          */
  232. !       "'\\%c'",  "'"                    
  233.      },
  234.      {
  235. +          /* Bourne-Again shell -- we treat it the same as the Bourne shell.
  236. +          ** (this should change when BASH supports arrays)
  237. +          */
  238.         BASH,  "bash",
  239.         "shift $#;\n",  
  240.         "%s=",  "'",  "';\n",
  241. ***************
  242. *** 258,298 ****
  243. --- 272,380 ----
  244.         "'\\%c'",  "'"
  245.      },
  246.      {
  247. +          /* Korn Shell */
  248.         KSH,  "ksh",
  249. +          /* "set -- ;" unsets the positional parameters */
  250.         "set --;\n",  
  251. +          /* "name='value'" assigns "value" to the variable "name" */
  252.         "%s=",  "'",  "';\n",
  253. +          /* "set [-+]A ary 'elt1' 'elt2' ..." assigns an array named "ary" */
  254.         "set %cA %s ",  "'",  "'%s'",  "';\n",
  255. +          /* the only character we need to escape is a "'", We do this by ending
  256. +          ** the current quote, escaping the quote, and starting a new one
  257. +          */
  258.         "'\\%c'",  "'"
  259.      },
  260.      {
  261. +          /* C-Shell */
  262.         CSH,  "csh",
  263. +          /* "set argv=()" unsets the positional parameters */
  264.         "set argv=();\n",  
  265. +          /* "set name='value'" assigns "value" to the variable "name" */
  266.         "set %s=",  "'",  "';\n",
  267. +          /* "set ary=( 'elt1' 'elt2' ... )" assigns an array named "ary" */
  268.         "set %s=",  "( '",  "'%s'",  "' );\n",
  269. +          /* the only character we need to escape is a "'", We do this by ending
  270. +          ** the current quote, escaping the quote, and starting a new one
  271. +          */
  272.         "'\\%c'",  "'"
  273.      },
  274.      {
  275. +          /* Z-Shell -- this is a lot like the C-Shell except we dont need
  276. +          ** the 'set' keyword when assigning variables and arrays
  277. +          */
  278.         ZSH,  "zsh",
  279. +          /* "argv=()" unsets the positional parameters */
  280.         "argv=();\n",  
  281. +          /* "name='value'" assigns "value" to the variable "name" */
  282.         "%s=",  "'",  "';\n",
  283. +          /* "ary=( 'elt1' 'elt2' ... )" assigns an array named "ary" */
  284.         "%s=",  "( '",  "'%s'",  "' );\n",
  285. +          /* the only character we need to escape is a "'", We do this by ending
  286. +          ** the current quote, escaping the quote, and starting a new one
  287. +          */
  288.         "'\\%c'",  "'"
  289.      },
  290.      {
  291. +          /* rc -- the Plan 9 shell designed by Tom Duff */
  292.         RC,  "rc",
  293. +          /* "*=()" unsets the positional parameters */
  294.         "*=();\n",  
  295. +          /* "name='value'" assigns "value" to the variable "name" */
  296.         "%s=",  "'",  "';\n",
  297. +          /* "ary=( 'elt1' 'elt2' ... )" assigns an array named "ary" */
  298.         "%s=",  "( '",  "'%s'",  "' );\n",
  299. +          /* the only character to escape is a "'", We do this by using
  300. +          ** two "'" characters in a row.
  301. +          */
  302.         "''",  "'"
  303.      },
  304.      {
  305. +          /* perl - Larry Wall's Practical Extraction and Reoprt Language */
  306.         PERL,  "perl",
  307. +          /* "@ARGV = ()" unsets the positional parameters */
  308.         "@ARGV = ();\n",  
  309. +          /* "$name = 'value' ;" assigns "value" to the variable "name" */
  310.         "$%s = ",  "'",  "';\n",
  311. +          /* "@ary = ( 'elt1', 'elt2', ... );" assigns an array named "ary" */
  312.         "@%s = ",  "( '",  "', '",  "' );\n",
  313. +          /* the only character to escape is a "'", We do this by preceding it
  314. +          ** with a backslash.
  315. +          */
  316.         "\\%c",  "'"
  317.      },
  318.      {
  319. +          /* awk -- Aho, Weinberger, & Kernighan's pattern-action language
  320. +          **
  321. +          ** we treat awk differently then the other shells. This is because
  322. +          ** we cant use actual awk syntax (since awk doesnt have the equivalent
  323. +          ** of an 'eval' command). Instead, we write out an input stream for
  324. +          ** consisting or variable assignments. Records are multi-line, and
  325. +          ** separated by a blank line. Fields are separated by a newline. 
  326. +          ** The first field is the name of the variable and the remaining
  327. +          ** fields (if more than one remains we have an array) of the values
  328. +          ** associated with the variable.
  329. +          */
  330.         AWK,  "awk",
  331.         "ARGV\n\n",  
  332.         "%s\n",  "",  "\n\n",
  333. ***************
  334. *** 352,357 ****
  335. --- 434,445 ----
  336.   
  337.   /*************************************************************************/
  338.   
  339. + /*
  340. + ** argVers() -- This is the function used to print the version of parseargs
  341. + **              on standard output and then exit (regardless of where its
  342. + **              corresponding '-#' appears on the command line and regardless
  343. + **              of what may have preceded it).
  344. + */
  345.   /*ARGSUSED*/
  346.   #ifdef __ANSI_C__
  347.      static BOOL argVers( register ARGDESC *ad,  register char *vp,  BOOL copyf )
  348. ***************
  349. *** 504,510 ****
  350.   ** ^REQUIREMENTS:
  351.   **    None.
  352.   **
  353. ! ** ^SIDE-EFECTS:
  354.   **    Storage associated with all dynamically allocated arg-vectors
  355.   **    is released and set to NULL.
  356.   **
  357. --- 592,598 ----
  358.   ** ^REQUIREMENTS:
  359.   **    None.
  360.   **
  361. ! ** ^SIDE-EFFECTS:
  362.   **    Storage associated with all dynamically allocated arg-vectors
  363.   **    is released and set to NULL.
  364.   **
  365. ***************
  366. *** 559,565 ****
  367.   ** ^REQUIREMENTS:
  368.   **    None.
  369.   **
  370. ! ** ^SIDE-EFECTS:
  371.   **    Storage associated with all dynamically allocated global-variables
  372.   **    is released and set to NULL.
  373.   **
  374. --- 647,653 ----
  375.   ** ^REQUIREMENTS:
  376.   **    None.
  377.   **
  378. ! ** ^SIDE-EFFECTS:
  379.   **    Storage associated with all dynamically allocated global-variables
  380.   **    is released and set to NULL.
  381.   **
  382. ***************
  383. *** 614,620 ****
  384.   ** ^REQUIREMENTS:
  385.   **    size should be > 0
  386.   **
  387. ! ** ^SIDE-EFECTS:
  388.   **    Memory is allocated that should later be deallocated using free().
  389.   **
  390.   ** ^RETURN-VALUE:
  391. --- 702,708 ----
  392.   ** ^REQUIREMENTS:
  393.   **    size should be > 0
  394.   **
  395. ! ** ^SIDE-EFFECTS:
  396.   **    Memory is allocated that should later be deallocated using free().
  397.   **
  398.   ** ^RETURN-VALUE:
  399. ***************
  400. *** 667,673 ****
  401.   ** ^REQUIREMENTS:
  402.   **    size should be > 0
  403.   **
  404. ! ** ^SIDE-EFECTS:
  405.   **    Memory is allocated that should later be deallocated using free().
  406.   **
  407.   ** ^RETURN-VALUE:
  408. --- 755,761 ----
  409.   ** ^REQUIREMENTS:
  410.   **    size should be > 0
  411.   **
  412. ! ** ^SIDE-EFFECTS:
  413.   **    Memory is allocated that should later be deallocated using free().
  414.   **
  415.   ** ^RETURN-VALUE:
  416. ***************
  417. *** 721,727 ****
  418.   **    Both <ch> and <esc> should be non-zero.
  419.   **    <str> should be non-null and non-empty.
  420.   **
  421. ! ** ^SIDE-EFECTS:
  422.   **    Each occurrence in <str> of <ch> within single or double quotes is
  423.   **    replaced with <esc>.
  424.   **
  425. --- 809,815 ----
  426.   **    Both <ch> and <esc> should be non-zero.
  427.   **    <str> should be non-null and non-empty.
  428.   **
  429. ! ** ^SIDE-EFFECTS:
  430.   **    Each occurrence in <str> of <ch> within single or double quotes is
  431.   **    replaced with <esc>.
  432.   **
  433. ***************
  434. *** 781,787 ****
  435.   **    It should be noted that escape_char() only replaces characters in quotes
  436.   **    whereas this routine replaces all occurrences.
  437.   **
  438. ! ** ^SIDE-EFECTS:
  439.   **    Each occurrence of <esc> in <str> is replaced with <ch>.
  440.   **
  441.   ** ^RETURN-VALUE:
  442. --- 869,875 ----
  443.   **    It should be noted that escape_char() only replaces characters in quotes
  444.   **    whereas this routine replaces all occurrences.
  445.   **
  446. ! ** ^SIDE-EFFECTS:
  447.   **    Each occurrence of <esc> in <str> is replaced with <ch>.
  448.   **
  449.   ** ^RETURN-VALUE:
  450. ***************
  451. *** 823,829 ****
  452.   ** ^REQUIREMENTS:
  453.   **    type_str should be non-NULL and non-empty
  454.   **
  455. ! ** ^SIDE-EFECTS:
  456.   **    None.
  457.   **
  458.   ** ^RETURN-VALUE:
  459. --- 911,917 ----
  460.   ** ^REQUIREMENTS:
  461.   **    type_str should be non-NULL and non-empty
  462.   **
  463. ! ** ^SIDE-EFFECTS:
  464.   **    None.
  465.   **
  466.   ** ^RETURN-VALUE:
  467. ***************
  468. *** 901,907 ****
  469.   ** ^REQUIREMENTS:
  470.   **    flag_str should be non-NULL and non-empty
  471.   **
  472. ! ** ^SIDE-EFECTS:
  473.   **    None.
  474.   **
  475.   ** ^RETURN-VALUE:
  476. --- 989,995 ----
  477.   ** ^REQUIREMENTS:
  478.   **    flag_str should be non-NULL and non-empty
  479.   **
  480. ! ** ^SIDE-EFFECTS:
  481.   **    None.
  482.   **
  483.   ** ^RETURN-VALUE:
  484. ***************
  485. *** 960,966 ****
  486.   ** ^REQUIREMENTS:
  487.   **    Standard input should be open for reading and be non-interactive.
  488.   **
  489. ! ** ^SIDE-EFECTS:
  490.   **    Memory is allocated that should later be deallocated using free.
  491.   **
  492.   ** ^RETURN-VALUE:
  493. --- 1048,1054 ----
  494.   ** ^REQUIREMENTS:
  495.   **    Standard input should be open for reading and be non-interactive.
  496.   **
  497. ! ** ^SIDE-EFFECTS:
  498.   **    Memory is allocated that should later be deallocated using free.
  499.   **
  500.   ** ^RETURN-VALUE:
  501. ***************
  502. *** 1078,1084 ****
  503.   ** ^REQUIREMENTS:
  504.   **    sh_str should be non-NULL and non-empty.
  505.   **
  506. ! ** ^SIDE-EFECTS:
  507.   **    None.
  508.   **
  509.   ** ^RETURN-VALUE:
  510. --- 1166,1172 ----
  511.   ** ^REQUIREMENTS:
  512.   **    sh_str should be non-NULL and non-empty.
  513.   **
  514. ! ** ^SIDE-EFFECTS:
  515.   **    None.
  516.   **
  517.   ** ^RETURN-VALUE:
  518. ***************
  519. *** 1141,1147 ****
  520.   ** ^REQUIREMENTS:
  521.   **    argd_str should be non-NULL and non-empty
  522.   **
  523. ! ** ^SIDE-EFECTS:
  524.   **    The global variables UsrVals and UsrArgd are allocated and initialized
  525.   **
  526.   ** ^RETURN-VALUE:
  527. --- 1229,1235 ----
  528.   ** ^REQUIREMENTS:
  529.   **    argd_str should be non-NULL and non-empty
  530.   **
  531. ! ** ^SIDE-EFFECTS:
  532.   **    The global variables UsrVals and UsrArgd are allocated and initialized
  533.   **
  534.   ** ^RETURN-VALUE:
  535. ***************
  536. *** 1357,1363 ****
  537.   **    <fp> should be non-NULL and open for writing.
  538.   **    <ch> should be a printable character.
  539.   **
  540. ! ** ^SIDE-EFECTS:
  541.   **    output is written to <fp>.
  542.   **
  543.   ** ^RETURN-VALUE:
  544. --- 1445,1451 ----
  545.   **    <fp> should be non-NULL and open for writing.
  546.   **    <ch> should be a printable character.
  547.   **
  548. ! ** ^SIDE-EFFECTS:
  549.   **    output is written to <fp>.
  550.   **
  551.   ** ^RETURN-VALUE:
  552. ***************
  553. *** 1416,1422 ****
  554.   **    <fp> should be non-NULL and open for writing.
  555.   **    <str> should be non-NULL and non-empty.
  556.   **
  557. ! ** ^SIDE-EFECTS:
  558.   **    Output is written to <fp>
  559.   **
  560.   ** ^RETURN-VALUE:
  561. --- 1504,1510 ----
  562.   **    <fp> should be non-NULL and open for writing.
  563.   **    <str> should be non-NULL and non-empty.
  564.   **
  565. ! ** ^SIDE-EFFECTS:
  566.   **    Output is written to <fp>
  567.   **
  568.   ** ^RETURN-VALUE:
  569. ***************
  570. *** 1470,1476 ****
  571.   ** ^REQUIREMENTS:
  572.   **    <val> should be the value corresponing to the argument-descriptor <ad>
  573.   **
  574. ! ** ^SIDE-EFECTS:
  575.   **    Output is written to <fp>.
  576.   **
  577.   ** ^RETURN-VALUE:
  578. --- 1558,1564 ----
  579.   ** ^REQUIREMENTS:
  580.   **    <val> should be the value corresponing to the argument-descriptor <ad>
  581.   **
  582. ! ** ^SIDE-EFFECTS:
  583.   **    Output is written to <fp>.
  584.   **
  585.   ** ^RETURN-VALUE:
  586. ***************
  587. *** 1732,1738 ****
  588.   ** ^REQUIREMENTS:
  589.   **    <val> should correspond to the vlue of the argument indicated by <ad>
  590.   **
  591. ! ** ^SIDE-EFECTS:
  592.   **    prints the array assignment statement on standard output
  593.   **
  594.   ** ^RETURN-VALUE:
  595. --- 1820,1826 ----
  596.   ** ^REQUIREMENTS:
  597.   **    <val> should correspond to the vlue of the argument indicated by <ad>
  598.   **
  599. ! ** ^SIDE-EFFECTS:
  600.   **    prints the array assignment statement on standard output
  601.   **
  602.   ** ^RETURN-VALUE:
  603. ***************
  604. *** 1825,1831 ****
  605.   **    The argument values have already been set due to the fact that parseargs
  606.   **    should already have been invoked to parse the command-line
  607.   **
  608. ! ** ^SIDE-EFECTS:
  609.   **    Variable assignment statements are printed on standard output.
  610.   **
  611.   ** ^RETURN-VALUE:
  612. --- 1913,1919 ----
  613.   **    The argument values have already been set due to the fact that parseargs
  614.   **    should already have been invoked to parse the command-line
  615.   **
  616. ! ** ^SIDE-EFFECTS:
  617.   **    Variable assignment statements are printed on standard output.
  618.   **
  619.   ** ^RETURN-VALUE:
  620. ***************
  621. *** 1926,1932 ****
  622.   ** ^REQUIREMENTS:
  623.   **    The currenty shell-type has already been determined.
  624.   **
  625. ! ** ^SIDE-EFECTS:
  626.   **    Prints on stdout.
  627.   **
  628.   ** ^RETURN-VALUE:
  629. --- 2014,2020 ----
  630.   ** ^REQUIREMENTS:
  631.   **    The currenty shell-type has already been determined.
  632.   **
  633. ! ** ^SIDE-EFFECTS:
  634.   **    Prints on stdout.
  635.   **
  636.   ** ^RETURN-VALUE:
  637. ***************
  638. *** 1962,1968 ****
  639.   ** ^REQUIREMENTS:
  640.   **    The command-line should already have been parsed by parseargs(3)
  641.   **
  642. ! ** ^SIDE-EFECTS:
  643.   **    - Exits the program if an error is encountered.
  644.   **    - Assigns any needed defaults for StrTrue and StrFalse.
  645.   **    - Gets the argd-string from an environment variable if needed
  646. --- 2050,2056 ----
  647.   ** ^REQUIREMENTS:
  648.   **    The command-line should already have been parsed by parseargs(3)
  649.   **
  650. ! ** ^SIDE-EFFECTS:
  651.   **    - Exits the program if an error is encountered.
  652.   **    - Assigns any needed defaults for StrTrue and StrFalse.
  653.   **    - Gets the argd-string from an environment variable if needed
  654. *** parseargs.h.OLD    Thu Aug 15 11:50:41 1991
  655. --- parseargs.h    Thu Aug  1 15:47:32 1991
  656. ***************
  657. *** 1011,1017 ****
  658.      EXTERN int   parsecntl   ARGS(( ARGDESC *, parsecntl_t, parsemode_t, ...));
  659.      EXTERN VOID  usage       ARGS(( const ARGDESC * ));
  660.      EXTERN VOID  init_args   ARGS(( ARGDESC * ));
  661. !    extern CONST char *ProgName;
  662.   #endif  /* PARSEARGS_NEXTERNS */
  663.   
  664.   #endif  /* PARSEARGS_H */
  665. --- 1011,1017 ----
  666.      EXTERN int   parsecntl   ARGS(( ARGDESC *, parsecntl_t, parsemode_t, ...));
  667.      EXTERN VOID  usage       ARGS(( const ARGDESC * ));
  668.      EXTERN VOID  init_args   ARGS(( ARGDESC * ));
  669. !    EXTERN CONST char *ProgName;
  670.   #endif  /* PARSEARGS_NEXTERNS */
  671.   
  672.   #endif  /* PARSEARGS_H */
  673. *** patchlevel.h.OLD    Thu Aug 15 11:50:53 1991
  674. --- patchlevel.h    Thu Aug 15 10:57:37 1991
  675. ***************
  676. *** 2,7 ****
  677. --- 2,17 ----
  678.   ** ^FILE: patchlevel.h - current patchlevel for parseargs
  679.   **
  680.   ** ^HISTORY:
  681. + **    08/15/91    Brad Appleton    <brad@ssd.csd.harris.com>
  682. + **    Patch08
  683. + **    - fixed some typos in the comments (SIDE-EFFECTS was misspelled
  684. + **      everywhere in the comments for the functions).
  685. + **    - fixed up external definition of ProgName to work for C++
  686. + **      (added extern "C").
  687. + **    - fixed up lparseargs() and vparseargs to free the argument vector
  688. + **      when it was finished with it.
  689. + **    - added some more comments to xparse.c and parseargs.c.
  690. + **
  691.   **    06/05/91    Brad Appleton    <brad@ssd.csd.harris.com>
  692.   **    Patch07
  693.   **    - fixed the "Intro" file to correctly show how to invoke parseargs(3)
  694. ***************
  695. *** 91,97 ****
  696.   
  697.   #define  VERSION     2
  698.   #define  REVISION    0
  699. ! #define  PATCHLEVEL  7
  700.   
  701.   #ifdef __STDC__
  702.      static const char
  703. --- 101,107 ----
  704.   
  705.   #define  VERSION     2
  706.   #define  REVISION    0
  707. ! #define  PATCHLEVEL  8
  708.   
  709.   #ifdef __STDC__
  710.      static const char
  711. ***************
  712. *** 98,101 ****
  713.   #else
  714.      static char
  715.   #endif
  716. !    _Ident[] = "@(#)parseargs  2.0  patchlevel 7";
  717. --- 108,111 ----
  718.   #else
  719.      static char
  720.   #endif
  721. !    _Ident[] = "@(#)parseargs  2.0  patchlevel 8";
  722. *** pgopen.c.OLD    Thu Aug 15 11:50:58 1991
  723. --- pgopen.c    Thu Aug  1 15:46:13 1991
  724. ***************
  725. *** 104,110 ****
  726.   **    pgopen() must first be called in order to obtain a valid
  727.   **    pager-file-pointer.
  728.   **
  729. ! ** ^SIDE-EFECTS:
  730.   **    None.
  731.   **
  732.   ** ^RETURN-VALUE:
  733. --- 104,110 ----
  734.   **    pgopen() must first be called in order to obtain a valid
  735.   **    pager-file-pointer.
  736.   **
  737. ! ** ^SIDE-EFFECTS:
  738.   **    None.
  739.   **
  740.   ** ^RETURN-VALUE:
  741. ***************
  742. *** 143,149 ****
  743.   **    pgopen() must first be called in order to obtain a valid
  744.   **    pager-file-pointer.
  745.   **
  746. ! ** ^SIDE-EFECTS:
  747.   **    None.
  748.   **
  749.   ** ^RETURN-VALUE:
  750. --- 143,149 ----
  751.   **    pgopen() must first be called in order to obtain a valid
  752.   **    pager-file-pointer.
  753.   **
  754. ! ** ^SIDE-EFFECTS:
  755.   **    None.
  756.   **
  757.   ** ^RETURN-VALUE:
  758. ***************
  759. *** 213,219 ****
  760.   **    program which reads from standard input and writes (one screenful
  761.   **    at a time) to the terminal.
  762.   **
  763. ! ** ^SIDE-EFECTS:
  764.   **    If popen() succeeds, the SIGPIPE signal is trapped.
  765.   **
  766.   ** ^RETURN-VALUE:
  767. --- 213,219 ----
  768.   **    program which reads from standard input and writes (one screenful
  769.   **    at a time) to the terminal.
  770.   **
  771. ! ** ^SIDE-EFFECTS:
  772.   **    If popen() succeeds, the SIGPIPE signal is trapped.
  773.   **
  774.   ** ^RETURN-VALUE:
  775. ***************
  776. *** 346,352 ****
  777.   **    Pgopen must place the address of the desired recovery point in
  778.   **    pg_recover.
  779.   **
  780. ! ** ^SIDE-EFECTS:
  781.   **    Resets SIGPIPE signal-handler and performs a non-local goto.
  782.   **
  783.   ** ^RETURN-VALUE:
  784. --- 346,352 ----
  785.   **    Pgopen must place the address of the desired recovery point in
  786.   **    pg_recover.
  787.   **
  788. ! ** ^SIDE-EFFECTS:
  789.   **    Resets SIGPIPE signal-handler and performs a non-local goto.
  790.   **
  791.   ** ^RETURN-VALUE:
  792. ***************
  793. *** 387,393 ****
  794.   **    pager_cmd must be non-null and be large enough to hold any of the
  795.   **    possible pager program-names to be opened.
  796.   **
  797. ! ** ^SIDE-EFECTS:
  798.   **    pager_cmd is over-written with the name of the pager-command to
  799.   **    try to open for output
  800.   **
  801. --- 387,393 ----
  802.   **    pager_cmd must be non-null and be large enough to hold any of the
  803.   **    possible pager program-names to be opened.
  804.   **
  805. ! ** ^SIDE-EFFECTS:
  806.   **    pager_cmd is over-written with the name of the pager-command to
  807.   **    try to open for output
  808.   **
  809. *** stest.c.OLD    Thu Aug 15 11:51:11 1991
  810. --- stest.c    Thu Aug  1 15:46:18 1991
  811. ***************
  812. *** 181,187 ****
  813.   ** ^REQUIREMENTS:
  814.   **    None.
  815.   **
  816. ! ** ^SIDE-EFECTS:
  817.   **    All the static-global argument variables are rewritten.
  818.   **
  819.   ** ^RETURN-VALUE:
  820. --- 181,187 ----
  821.   ** ^REQUIREMENTS:
  822.   **    None.
  823.   **
  824. ! ** ^SIDE-EFFECTS:
  825.   **    All the static-global argument variables are rewritten.
  826.   **
  827.   ** ^RETURN-VALUE:
  828. ***************
  829. *** 233,239 ****
  830.   **    The command-line should have already been parsed by one of the
  831.   **    Xparseargs functions.
  832.   **
  833. ! ** ^SIDE-EFECTS:
  834.   **    Prints on stdout.
  835.   **
  836.   ** ^RETURN-VALUE:
  837. --- 233,239 ----
  838.   **    The command-line should have already been parsed by one of the
  839.   **    Xparseargs functions.
  840.   **
  841. ! ** ^SIDE-EFFECTS:
  842.   **    Prints on stdout.
  843.   **
  844.   ** ^RETURN-VALUE:
  845. *** strfuncs.c.OLD    Thu Aug 15 11:51:18 1991
  846. --- strfuncs.c    Thu Aug  1 15:46:24 1991
  847. ***************
  848. *** 80,86 ****
  849.   ** ^REQUIREMENTS:
  850.   **    Dest must be non-null, and large enough to hold the copied result.
  851.   **
  852. ! ** ^SIDE-EFECTS:
  853.   **    Dest is (re)written
  854.   **
  855.   ** ^RETURN-VALUE:
  856. --- 80,86 ----
  857.   ** ^REQUIREMENTS:
  858.   **    Dest must be non-null, and large enough to hold the copied result.
  859.   **
  860. ! ** ^SIDE-EFFECTS:
  861.   **    Dest is (re)written
  862.   **
  863.   ** ^RETURN-VALUE:
  864. ***************
  865. *** 147,153 ****
  866.   ** ^REQUIREMENTS:
  867.   **    str should be non-null and non-empty.
  868.   **
  869. ! ** ^SIDE-EFECTS:
  870.   **    str is overwritten with the uppercase (lowercase) result.
  871.   **
  872.   ** ^RETURN-VALUE:
  873. --- 147,153 ----
  874.   ** ^REQUIREMENTS:
  875.   **    str should be non-null and non-empty.
  876.   **
  877. ! ** ^SIDE-EFFECTS:
  878.   **    str is overwritten with the uppercase (lowercase) result.
  879.   **
  880.   ** ^RETURN-VALUE:
  881. ***************
  882. *** 212,218 ****
  883.   ** ^REQUIREMENTS:
  884.   **    Both s1 and s2 should be non-null and non-empty
  885.   **
  886. ! ** ^SIDE-EFECTS:
  887.   **    None.
  888.   **
  889.   ** ^RETURN-VALUE:
  890. --- 212,218 ----
  891.   ** ^REQUIREMENTS:
  892.   **    Both s1 and s2 should be non-null and non-empty
  893.   **
  894. ! ** ^SIDE-EFFECTS:
  895.   **    None.
  896.   **
  897.   ** ^RETURN-VALUE:
  898. ***************
  899. *** 344,350 ****
  900.   ** ^REQUIREMENTS:
  901.   **    Both str1 and str2 should be non-null and non-empty
  902.   **
  903. ! ** ^SIDE-EFECTS:
  904.   **    None.
  905.   **
  906.   ** ^RETURN-VALUE:
  907. --- 344,350 ----
  908.   ** ^REQUIREMENTS:
  909.   **    Both str1 and str2 should be non-null and non-empty
  910.   **
  911. ! ** ^SIDE-EFFECTS:
  912.   **    None.
  913.   **
  914.   ** ^RETURN-VALUE:
  915. ***************
  916. *** 394,400 ****
  917.   ** ^REQUIREMENTS:
  918.   **    Both str1 and str2 should be non-null and non-empty.
  919.   **
  920. ! ** ^SIDE-EFECTS:
  921.   **    None.
  922.   **
  923.   ** ^RETURN-VALUE:
  924. --- 394,400 ----
  925.   ** ^REQUIREMENTS:
  926.   **    Both str1 and str2 should be non-null and non-empty.
  927.   **
  928. ! ** ^SIDE-EFFECTS:
  929.   **    None.
  930.   **
  931.   ** ^RETURN-VALUE:
  932. ***************
  933. *** 477,483 ****
  934.   ** ^REQUIREMENTS:
  935.   **    str should be non-null and non-empty.
  936.   **
  937. ! ** ^SIDE-EFECTS:
  938.   **    characters may be removed from the beginning and/or end of str.
  939.   **
  940.   ** ^RETURN-VALUE:
  941. --- 477,483 ----
  942.   ** ^REQUIREMENTS:
  943.   **    str should be non-null and non-empty.
  944.   **
  945. ! ** ^SIDE-EFFECTS:
  946.   **    characters may be removed from the beginning and/or end of str.
  947.   **
  948.   ** ^RETURN-VALUE:
  949. ***************
  950. *** 584,590 ****
  951.   **    vec must be non-NULL (it must be a valid address).
  952.   **    token_str should be non-null and non-empty
  953.   **
  954. ! ** ^SIDE-EFECTS:
  955.   **    All leading and trailing characters from <separators> are removed
  956.   **    from token_str. Furthermore, all remaining sequences in token_str
  957.   **    of characters from <separators> are replaced with a single NUL-byte.
  958. --- 584,590 ----
  959.   **    vec must be non-NULL (it must be a valid address).
  960.   **    token_str should be non-null and non-empty
  961.   **
  962. ! ** ^SIDE-EFFECTS:
  963.   **    All leading and trailing characters from <separators> are removed
  964.   **    from token_str. Furthermore, all remaining sequences in token_str
  965.   **    of characters from <separators> are replaced with a single NUL-byte.
  966. ***************
  967. *** 693,699 ****
  968.   **    argv must be non-NULL (it must be a valid address), and must be
  969.   **    terminated by a pointer to NULL (argv[last+1] == NULL).
  970.   **
  971. ! ** ^SIDE-EFECTS:
  972.   **    Storage is allocated.
  973.   **
  974.   ** ^RETURN-VALUE:
  975. --- 693,699 ----
  976.   **    argv must be non-NULL (it must be a valid address), and must be
  977.   **    terminated by a pointer to NULL (argv[last+1] == NULL).
  978.   **
  979. ! ** ^SIDE-EFFECTS:
  980.   **    Storage is allocated.
  981.   **
  982.   ** ^RETURN-VALUE:
  983. ***************
  984. *** 773,779 ****
  985.   **    Both s and buf must be non-null and non-empty.
  986.   **    buf must be large enough to hold the result.
  987.   **
  988. ! ** ^SIDE-EFECTS:
  989.   **    buf is overwritten.
  990.   **
  991.   ** ^RETURN-VALUE:
  992. --- 773,779 ----
  993.   **    Both s and buf must be non-null and non-empty.
  994.   **    buf must be large enough to hold the result.
  995.   **
  996. ! ** ^SIDE-EFFECTS:
  997.   **    buf is overwritten.
  998.   **
  999.   ** ^RETURN-VALUE:
  1000. ***************
  1001. *** 834,840 ****
  1002.   **    Both s and buf must be non-null and non-empty.
  1003.   **    buf must be large enough to hold the result.
  1004.   **
  1005. ! ** ^SIDE-EFECTS:
  1006.   **    buf is overwritten.
  1007.   *
  1008.   ** ^RETURN-VALUE:
  1009. --- 834,840 ----
  1010.   **    Both s and buf must be non-null and non-empty.
  1011.   **    buf must be large enough to hold the result.
  1012.   **
  1013. ! ** ^SIDE-EFFECTS:
  1014.   **    buf is overwritten.
  1015.   *
  1016.   ** ^RETURN-VALUE:
  1017. ***************
  1018. *** 915,921 ****
  1019.   **    Both candidate and target should be non-null and non-empty.
  1020.   **    target should be the ad_prompt field of an ARGDESC structure.
  1021.   **
  1022. ! ** ^SIDE-EFECTS:
  1023.   **    None.
  1024.   **
  1025.   ** ^RETURN-VALUE:
  1026. --- 915,921 ----
  1027.   **    Both candidate and target should be non-null and non-empty.
  1028.   **    target should be the ad_prompt field of an ARGDESC structure.
  1029.   **
  1030. ! ** ^SIDE-EFFECTS:
  1031.   **    None.
  1032.   **
  1033.   ** ^RETURN-VALUE:
  1034. ***************
  1035. *** 1035,1041 ****
  1036.   **    path should be non-null, non-empty, and should correspond to a valid
  1037.   **    pathname (absolute or relative).
  1038.   **
  1039. ! ** ^SIDE-EFECTS:
  1040.   **    None under Unix and AmigaDOS.
  1041.   **
  1042.   **    Under VMS, the file version is removed and any .COM or .EXE extension
  1043. --- 1035,1041 ----
  1044.   **    path should be non-null, non-empty, and should correspond to a valid
  1045.   **    pathname (absolute or relative).
  1046.   **
  1047. ! ** ^SIDE-EFFECTS:
  1048.   **    None under Unix and AmigaDOS.
  1049.   **
  1050.   **    Under VMS, the file version is removed and any .COM or .EXE extension
  1051. ***************
  1052. *** 1180,1186 ****
  1053.   ** ^REQUIREMENTS:
  1054.   **    maxcols and indent must be positive numbers with maxcols > indent
  1055.   **
  1056. ! ** ^SIDE-EFECTS:
  1057.   **    Output is printed to fp.
  1058.   **
  1059.   ** ^RETURN-VALUE:
  1060. --- 1180,1186 ----
  1061.   ** ^REQUIREMENTS:
  1062.   **    maxcols and indent must be positive numbers with maxcols > indent
  1063.   **
  1064. ! ** ^SIDE-EFFECTS:
  1065.   **    Output is printed to fp.
  1066.   **
  1067.   ** ^RETURN-VALUE:
  1068. *** syserr.c.OLD    Thu Aug 15 11:51:32 1991
  1069. --- syserr.c    Thu Aug  1 15:46:29 1991
  1070. ***************
  1071. *** 57,63 ****
  1072.   ** ^REQUIREMENTS:
  1073.   **    None.
  1074.   **
  1075. ! ** ^SIDE-EFECTS:
  1076.   **    Writes to stderr.
  1077.   **
  1078.   ** ^RETURN-VALUE:
  1079. --- 57,63 ----
  1080.   ** ^REQUIREMENTS:
  1081.   **    None.
  1082.   **
  1083. ! ** ^SIDE-EFFECTS:
  1084.   **    Writes to stderr.
  1085.   **
  1086.   ** ^RETURN-VALUE:
  1087. ***************
  1088. *** 115,121 ****
  1089.   ** ^REQUIREMENTS:
  1090.   **    No special requirements.
  1091.   **
  1092. ! ** ^SIDE-EFECTS:
  1093.   **    All output is written to stderr. Program execution is terminated.
  1094.   **
  1095.   ** ^RETURN-VALUE:
  1096. --- 115,121 ----
  1097.   ** ^REQUIREMENTS:
  1098.   **    No special requirements.
  1099.   **
  1100. ! ** ^SIDE-EFFECTS:
  1101.   **    All output is written to stderr. Program execution is terminated.
  1102.   **
  1103.   ** ^RETURN-VALUE:
  1104. ***************
  1105. *** 173,179 ****
  1106.   ** ^REQUIREMENTS:
  1107.   **    None.
  1108.   **
  1109. ! ** ^SIDE-EFECTS:
  1110.   **    Writes to stderr.
  1111.   **
  1112.   ** ^RETURN-VALUE:
  1113. --- 173,179 ----
  1114.   ** ^REQUIREMENTS:
  1115.   **    None.
  1116.   **
  1117. ! ** ^SIDE-EFFECTS:
  1118.   **    Writes to stderr.
  1119.   **
  1120.   ** ^RETURN-VALUE:
  1121. ***************
  1122. *** 224,230 ****
  1123.   ** ^REQUIREMENTS:
  1124.   **    No special requirements.
  1125.   **
  1126. ! ** ^SIDE-EFECTS:
  1127.   **    All output is written to stderr.  Errno is cleared.
  1128.   **
  1129.   ** ^RETURN-VALUE:
  1130. --- 224,230 ----
  1131.   ** ^REQUIREMENTS:
  1132.   **    No special requirements.
  1133.   **
  1134. ! ** ^SIDE-EFFECTS:
  1135.   **    All output is written to stderr.  Errno is cleared.
  1136.   **
  1137.   ** ^RETURN-VALUE:
  1138. *** test.rc.OLD    Thu Aug 15 11:51:57 1991
  1139. --- test.rc    Thu Aug 15 11:01:23 1991
  1140. ***************
  1141. *** 1,6 ****
  1142. --- 1,10 ----
  1143.   #!/bin/rc
  1144.   #    test.rc - rc shell script to test out the parseargs command!
  1145.   #
  1146. + #   NOTE: This script tests Byron Rakitzis' version of rc. NOT the
  1147. + #         Plan 9 version (there are a few differences such as the use
  1148. + #         of "else" instead of "if not" and the use of "$^variable").
  1149. + #
  1150.   NAME=`{basename $0}
  1151.   
  1152.   ARGUMENTS='
  1153. *** unix_args.c.OLD    Thu Aug 15 11:52:16 1991
  1154. --- unix_args.c    Thu Aug  1 15:46:35 1991
  1155. ***************
  1156. *** 86,92 ****
  1157.   ** ^REQUIREMENTS:
  1158.   **    The final element in argv must be a NULL pointer.
  1159.   **
  1160. ! ** ^SIDE-EFECTS:
  1161.   **    argd is modified according to the command-line description and parameters
  1162.   **
  1163.   ** ^RETURN-VALUE:
  1164. --- 86,92 ----
  1165.   ** ^REQUIREMENTS:
  1166.   **    The final element in argv must be a NULL pointer.
  1167.   **
  1168. ! ** ^SIDE-EFFECTS:
  1169.   **    argd is modified according to the command-line description and parameters
  1170.   **
  1171.   ** ^RETURN-VALUE:
  1172. ***************
  1173. *** 484,490 ****
  1174.   **    buf must be large enough to hold the formatted result (100 characters
  1175.   **    should do the trick).
  1176.   **
  1177. ! ** ^SIDE-EFECTS:
  1178.   **    buf is overwritten.
  1179.   **
  1180.   ** ^RETURN-VALUE:
  1181. --- 484,490 ----
  1182.   **    buf must be large enough to hold the formatted result (100 characters
  1183.   **    should do the trick).
  1184.   **
  1185. ! ** ^SIDE-EFFECTS:
  1186.   **    buf is overwritten.
  1187.   **
  1188.   ** ^RETURN-VALUE:
  1189. ***************
  1190. *** 574,580 ****
  1191.   ** ^REQUIREMENTS:
  1192.   **    argd should be a non-null command-line argument-descriptor array
  1193.   **
  1194. ! ** ^SIDE-EFECTS:
  1195.   **    Prints on stderr.
  1196.   **
  1197.   ** ^RETURN-VALUE:
  1198. --- 574,580 ----
  1199.   ** ^REQUIREMENTS:
  1200.   **    argd should be a non-null command-line argument-descriptor array
  1201.   **
  1202. ! ** ^SIDE-EFFECTS:
  1203.   **    Prints on stderr.
  1204.   **
  1205.   ** ^RETURN-VALUE:
  1206. *** unix_man.c.OLD    Thu Aug 15 11:52:23 1991
  1207. --- unix_man.c    Thu Aug  1 15:46:44 1991
  1208. ***************
  1209. *** 56,62 ****
  1210.   **    buf must be large enough to hold the formatted result (100 characters
  1211.   **    should do the trick).
  1212.   **
  1213. ! ** ^SIDE-EFECTS:
  1214.   **    buf is overwritten.
  1215.   **
  1216.   ** ^RETURN-VALUE:
  1217. --- 56,62 ----
  1218.   **    buf must be large enough to hold the formatted result (100 characters
  1219.   **    should do the trick).
  1220.   **
  1221. ! ** ^SIDE-EFFECTS:
  1222.   **    buf is overwritten.
  1223.   **
  1224.   ** ^RETURN-VALUE:
  1225. ***************
  1226. *** 144,150 ****
  1227.   ** ^REQUIREMENTS:
  1228.   **    Argd should be a valid command-line descriptor array.
  1229.   **
  1230. ! ** ^SIDE-EFECTS:
  1231.   **    Prints on standard-output.
  1232.   **
  1233.   ** ^RETURN-VALUE:
  1234. --- 144,150 ----
  1235.   ** ^REQUIREMENTS:
  1236.   **    Argd should be a valid command-line descriptor array.
  1237.   **
  1238. ! ** ^SIDE-EFFECTS:
  1239.   **    Prints on standard-output.
  1240.   **
  1241.   ** ^RETURN-VALUE:
  1242. *** vms_args.c.OLD    Thu Aug 15 11:52:36 1991
  1243. --- vms_args.c    Thu Aug  1 15:47:00 1991
  1244. ***************
  1245. *** 101,107 ****
  1246.   ** ^REQUIREMENTS:
  1247.   **    argv must be non-null
  1248.   **
  1249. ! ** ^SIDE-EFECTS:
  1250.   **    *result is assigned to either the concatenated argv string or the
  1251.   **    original command-line. The result shoub be freed using free().
  1252.   **
  1253. --- 101,107 ----
  1254.   ** ^REQUIREMENTS:
  1255.   **    argv must be non-null
  1256.   **
  1257. ! ** ^SIDE-EFFECTS:
  1258.   **    *result is assigned to either the concatenated argv string or the
  1259.   **    original command-line. The result shoub be freed using free().
  1260.   **
  1261. ***************
  1262. *** 193,199 ****
  1263.   ** ^REQUIREMENTS:
  1264.   **    <str> should be non-null and non-empty
  1265.   **
  1266. ! ** ^SIDE-EFECTS:
  1267.   **    <str> is "trimmed" to canonical form and special characters are mapped
  1268.   **    to a unique code.
  1269.   **
  1270. --- 193,199 ----
  1271.   ** ^REQUIREMENTS:
  1272.   **    <str> should be non-null and non-empty
  1273.   **
  1274. ! ** ^SIDE-EFFECTS:
  1275.   **    <str> is "trimmed" to canonical form and special characters are mapped
  1276.   **    to a unique code.
  1277.   **
  1278. ***************
  1279. *** 473,479 ****
  1280.   **    <vp> must already be preprocessed by dcl_strxlat to escape any quoted
  1281.   **    characters and to map special characters to their corresponding values.
  1282.   **
  1283. ! ** ^SIDE-EFECTS:
  1284.   **    Ad has some of its flags modified as well as any modifications that
  1285.   **    are made by the ad_type function.
  1286.   **
  1287. --- 473,479 ----
  1288.   **    <vp> must already be preprocessed by dcl_strxlat to escape any quoted
  1289.   **    characters and to map special characters to their corresponding values.
  1290.   **
  1291. ! ** ^SIDE-EFFECTS:
  1292.   **    Ad has some of its flags modified as well as any modifications that
  1293.   **    are made by the ad_type function.
  1294.   **
  1295. ***************
  1296. *** 551,557 ****
  1297.   ** ^REQUIREMENTS:
  1298.   **    The final element in argv must be a NULL pointer.
  1299.   **
  1300. ! ** ^SIDE-EFECTS:
  1301.   **    argd is modified according to the command-line description and parameters
  1302.   **
  1303.   ** ^RETURN-VALUE:
  1304. --- 551,557 ----
  1305.   ** ^REQUIREMENTS:
  1306.   **    The final element in argv must be a NULL pointer.
  1307.   **
  1308. ! ** ^SIDE-EFFECTS:
  1309.   **    argd is modified according to the command-line description and parameters
  1310.   **
  1311.   ** ^RETURN-VALUE:
  1312. ***************
  1313. *** 830,836 ****
  1314.   **    buf must be large enough to hold the formatted result (100 characters
  1315.   **    should do the trick).
  1316.   **
  1317. ! ** ^SIDE-EFECTS:
  1318.   **    buf is overwritten.
  1319.   **
  1320.   ** ^RETURN-VALUE:
  1321. --- 830,836 ----
  1322.   **    buf must be large enough to hold the formatted result (100 characters
  1323.   **    should do the trick).
  1324.   **
  1325. ! ** ^SIDE-EFFECTS:
  1326.   **    buf is overwritten.
  1327.   **
  1328.   ** ^RETURN-VALUE:
  1329. ***************
  1330. *** 900,906 ****
  1331.   ** ^REQUIREMENTS:
  1332.   **    argd should be a non-null command-line argument-descriptor array
  1333.   **
  1334. ! ** ^SIDE-EFECTS:
  1335.   **    Prints on stderr.
  1336.   **
  1337.   ** ^RETURN-VALUE:
  1338. --- 900,906 ----
  1339.   ** ^REQUIREMENTS:
  1340.   **    argd should be a non-null command-line argument-descriptor array
  1341.   **
  1342. ! ** ^SIDE-EFFECTS:
  1343.   **    Prints on stderr.
  1344.   **
  1345.   ** ^RETURN-VALUE:
  1346. *** xparse.c.OLD    Thu Aug 15 11:52:58 1991
  1347. --- xparse.c    Thu Aug 15 11:20:40 1991
  1348. ***************
  1349. *** 224,236 ****
  1350.   
  1351.   #ifdef vms_style
  1352.   # ifdef vms
  1353. !    { '<', ARGHIDDEN, argInput, __ &stdin,   "INPUT (redirect SYS$INPUT)" },
  1354. !    { '>', ARGHIDDEN, argOutput, __ &stdout, "OUTPUT (redirect SYS$OUTPUT)" },
  1355. !    { '%', ARGHIDDEN, argOutput, __ &stderr, "ERROR (redirect SYS$ERROR)" },
  1356.   # else
  1357. !    { '<', ARGHIDDEN, argInput, __ stdin,   "INPUT (redirect SYS$INPUT)" },
  1358. !    { '>', ARGHIDDEN, argOutput, __ stdout, "OUTPUT (redirect SYS$OUTPUT)" },
  1359. !    { '%', ARGHIDDEN, argOutput, __ stderr, "ERROR (redirect SYS$ERROR)" },
  1360.   # endif
  1361.   #endif
  1362.   
  1363. --- 224,236 ----
  1364.   
  1365.   #ifdef vms_style
  1366.   # ifdef vms
  1367. !    { '<', ARGHIDDEN, argInput, __ &stdin,   "sysINPUT (redirect SYS$INPUT)" },
  1368. !    { '>', ARGHIDDEN, argOutput, __ &stdout, "sysOUTPUT (redirect SYS$OUTPUT)" },
  1369. !    { '%', ARGHIDDEN, argOutput, __ &stderr, "sysERROR (redirect SYS$ERROR)" },
  1370.   # else
  1371. !    { '<', ARGHIDDEN, argInput, __ stdin,   "sysINPUT (redirect SYS$INPUT)" },
  1372. !    { '>', ARGHIDDEN, argOutput, __ stdout, "sysOUTPUT (redirect SYS$OUTPUT)" },
  1373. !    { '%', ARGHIDDEN, argOutput, __ stderr, "sysERROR (redirect SYS$ERROR)" },
  1374.   # endif
  1375.   #endif
  1376.   
  1377. ***************
  1378. *** 283,289 ****
  1379.      ** ^REQUIREMENTS:
  1380.      **    sym_name should correspond to the name of a pre-defined symbol.
  1381.      **
  1382. !    ** ^SIDE-EFECTS:
  1383.      **    None.
  1384.      **
  1385.      ** ^RETURN-VALUE:
  1386. --- 283,289 ----
  1387.      ** ^REQUIREMENTS:
  1388.      **    sym_name should correspond to the name of a pre-defined symbol.
  1389.      **
  1390. !    ** ^SIDE-EFFECTS:
  1391.      **    None.
  1392.      **
  1393.      ** ^RETURN-VALUE:
  1394. ***************
  1395. *** 344,350 ****
  1396.   ** ^REQUIREMENTS:
  1397.   **    Fd must correspond to a valid, open, file-descriptor.
  1398.   **
  1399. ! ** ^SIDE-EFECTS:
  1400.   **    None.
  1401.   **
  1402.   ** ^RETURN-VALUE:
  1403. --- 344,350 ----
  1404.   ** ^REQUIREMENTS:
  1405.   **    Fd must correspond to a valid, open, file-descriptor.
  1406.   **
  1407. ! ** ^SIDE-EFFECTS:
  1408.   **    None.
  1409.   **
  1410.   ** ^RETURN-VALUE:
  1411. ***************
  1412. *** 413,419 ****
  1413.   ** ^REQUIREMENTS:
  1414.   **    str should be non-null and non-empty
  1415.   **
  1416. ! ** ^SIDE-EFECTS:
  1417.   **    The characters which separated the two portions of <str> are
  1418.   **    replaced with a single '\0'.
  1419.   **
  1420. --- 413,419 ----
  1421.   ** ^REQUIREMENTS:
  1422.   **    str should be non-null and non-empty
  1423.   **
  1424. ! ** ^SIDE-EFFECTS:
  1425.   **    The characters which separated the two portions of <str> are
  1426.   **    replaced with a single '\0'.
  1427.   **
  1428. ***************
  1429. *** 497,503 ****
  1430.   **    <argd> must point to an array that has been declared using the CMD_XXXX
  1431.   **    macros, or using the ENDOFARGS (and optionally STARTOFARGS) macro.
  1432.   **
  1433. ! ** ^SIDE-EFECTS:
  1434.   **    The argd is initialized for use.
  1435.   **
  1436.   ** ^RETURN-VALUE:
  1437. --- 497,503 ----
  1438.   **    <argd> must point to an array that has been declared using the CMD_XXXX
  1439.   **    macros, or using the ENDOFARGS (and optionally STARTOFARGS) macro.
  1440.   **
  1441. ! ** ^SIDE-EFFECTS:
  1442.   **    The argd is initialized for use.
  1443.   **
  1444.   ** ^RETURN-VALUE:
  1445. ***************
  1446. *** 642,648 ****
  1447.   **    <argd> must point to an array that has been declared using the CMD_XXXX
  1448.   **    macros, or using the ENDOFARGS (and optionally STARTOFARGS) macro.
  1449.   **
  1450. ! ** ^SIDE-EFECTS:
  1451.   **    resets the ARG flags of each argument and the command-state of argd.
  1452.   **
  1453.   ** ^RETURN-VALUE:
  1454. --- 642,648 ----
  1455.   **    <argd> must point to an array that has been declared using the CMD_XXXX
  1456.   **    macros, or using the ENDOFARGS (and optionally STARTOFARGS) macro.
  1457.   **
  1458. ! ** ^SIDE-EFFECTS:
  1459.   **    resets the ARG flags of each argument and the command-state of argd.
  1460.   **
  1461.   ** ^RETURN-VALUE:
  1462. ***************
  1463. *** 723,729 ****
  1464.   ** ^REQUIREMENTS:
  1465.   **    Only the first 255 characters of user input is used.
  1466.   **
  1467. ! ** ^SIDE-EFECTS:
  1468.   **    Modifies <ad> accordingly.
  1469.   **
  1470.   ** ^RETURN-VALUE:
  1471. --- 723,729 ----
  1472.   ** ^REQUIREMENTS:
  1473.   **    Only the first 255 characters of user input is used.
  1474.   **
  1475. ! ** ^SIDE-EFFECTS:
  1476.   **    Modifies <ad> accordingly.
  1477.   **
  1478.   ** ^RETURN-VALUE:
  1479. ***************
  1480. *** 828,834 ****
  1481.   **    parse_status should be a pointer to the result of a previous call to
  1482.   **    {f,l,s,v,}parseargs.
  1483.   **
  1484. ! ** ^SIDE-EFECTS:
  1485.   **    The arg-descs for missing arguments may be modified by prompt_user.
  1486.   **    parse_status will be modified to indicate whether or not a syntax
  1487.   **    error really has occurred (it will be pe_SUCCESS if all is hunky-dory).
  1488. --- 828,834 ----
  1489.   **    parse_status should be a pointer to the result of a previous call to
  1490.   **    {f,l,s,v,}parseargs.
  1491.   **
  1492. ! ** ^SIDE-EFFECTS:
  1493.   **    The arg-descs for missing arguments may be modified by prompt_user.
  1494.   **    parse_status will be modified to indicate whether or not a syntax
  1495.   **    error really has occurred (it will be pe_SUCCESS if all is hunky-dory).
  1496. ***************
  1497. *** 943,949 ****
  1498.   **    by preceding it with one of '!', '^', or '~'. Tokens must be separated by
  1499.   **    one or more non-alphanumerics (other than '!', '~', and '^').
  1500.   **
  1501. ! ** ^SIDE-EFECTS:
  1502.   **    None.
  1503.   **
  1504.   ** ^RETURN-VALUE:
  1505. --- 943,949 ----
  1506.   **    by preceding it with one of '!', '^', or '~'. Tokens must be separated by
  1507.   **    one or more non-alphanumerics (other than '!', '~', and '^').
  1508.   **
  1509. ! ** ^SIDE-EFFECTS:
  1510.   **    None.
  1511.   **
  1512.   ** ^RETURN-VALUE:
  1513. ***************
  1514. *** 1088,1094 ****
  1515.   **    <cmd> must point to an array that has been declared using the CMD_XXXX
  1516.   **    macros, or using the ENDOFARGS (and optionally STARTOFARGS) macro.
  1517.   **
  1518. ! ** ^SIDE-EFECTS:
  1519.   **    None.
  1520.   **
  1521.   ** ^RETURN-VALUE:
  1522. --- 1088,1094 ----
  1523.   **    <cmd> must point to an array that has been declared using the CMD_XXXX
  1524.   **    macros, or using the ENDOFARGS (and optionally STARTOFARGS) macro.
  1525.   **
  1526. ! ** ^SIDE-EFFECTS:
  1527.   **    None.
  1528.   **
  1529.   ** ^RETURN-VALUE:
  1530. ***************
  1531. *** 1228,1234 ****
  1532.   **    <cmd> must point to an array that has been declared using the CMD_XXXX
  1533.   **    macros, or using the ENDOFARGS (and optionally STARTOFARGS) macro.
  1534.   **
  1535. ! ** ^SIDE-EFECTS:
  1536.   **    Modifies the parse-flags of <cmd> is $PARSECNTL is non-null & non-empty.
  1537.   **
  1538.   ** ^RETURN-VALUE:
  1539. --- 1228,1234 ----
  1540.   **    <cmd> must point to an array that has been declared using the CMD_XXXX
  1541.   **    macros, or using the ENDOFARGS (and optionally STARTOFARGS) macro.
  1542.   **
  1543. ! ** ^SIDE-EFFECTS:
  1544.   **    Modifies the parse-flags of <cmd> is $PARSECNTL is non-null & non-empty.
  1545.   **
  1546.   ** ^RETURN-VALUE:
  1547. ***************
  1548. *** 1339,1345 ****
  1549.   **    <cmd> should be an array of ARGDESCs declared using the CMD_XXXX macros
  1550.   **    or with the ENDOFARGS (and possible STARTOFARGS) macros.
  1551.   **
  1552. ! ** ^SIDE-EFECTS:
  1553.   **    Any matched arguments have their ARGDESCs modified accordingly.
  1554.   **    Also, the command-state is changed to reflect the fact that the
  1555.   **    environment variable has been parsed. Also, after parsing the
  1556. --- 1339,1345 ----
  1557.   **    <cmd> should be an array of ARGDESCs declared using the CMD_XXXX macros
  1558.   **    or with the ENDOFARGS (and possible STARTOFARGS) macros.
  1559.   **
  1560. ! ** ^SIDE-EFFECTS:
  1561.   **    Any matched arguments have their ARGDESCs modified accordingly.
  1562.   **    Also, the command-state is changed to reflect the fact that the
  1563.   **    environment variable has been parsed. Also, after parsing the
  1564. ***************
  1565. *** 1375,1385 ****
  1566. --- 1375,1390 ----
  1567.   
  1568.      if ( !CMD_isINIT(cmd) )  init_args( cmd );
  1569.   
  1570. +       /* if ignoring the <CMD>_ARGS variable then just return */
  1571.      if ( BTEST(cmd_state(cmd), ps_NOCMDENV) )  return;
  1572.   
  1573. +       /* build the name of the environment variable */
  1574.      strucpy( env_name, ProgName );
  1575.      strcat( env_name, ENV_SUFFIX );
  1576.   
  1577. +       /* get the value of the environment variable,
  1578. +       ** split it up into tokens, and parse it.
  1579. +       */
  1580.      env_args = getenv(env_name);
  1581.      if ( env_args ) {
  1582.         char **argv = (char **)NULL;
  1583. ***************
  1584. *** 1402,1407 ****
  1585. --- 1407,1413 ----
  1586.         cmd_prev(cmd) = ARGDESCNULL;
  1587.   #endif
  1588.   
  1589. +          /* check for errors */
  1590.         if ( rc  &&  !BTEST(cmd_flags(cmd), pa_IGNORE) ) {
  1591.            eprintf( "%s: syntax-error in %s \"%s\".\n",
  1592.                     ProgName, USER_VARIABLE, env_name );
  1593. ***************
  1594. *** 1444,1450 ****
  1595.   **    <argdp> should point to an array of ARGDESCs declared using the CMD_XXXX
  1596.   **    macros or with the ENDOFARGS (and possible STARTOFARGS) macros.
  1597.   **
  1598. ! ** ^SIDE-EFECTS:
  1599.   **      Initialize argd and parses any default arguments.
  1600.   **
  1601.   ** ^RETURN-VALUE:
  1602. --- 1450,1456 ----
  1603.   **    <argdp> should point to an array of ARGDESCs declared using the CMD_XXXX
  1604.   **    macros or with the ENDOFARGS (and possible STARTOFARGS) macros.
  1605.   **
  1606. ! ** ^SIDE-EFFECTS:
  1607.   **      Initialize argd and parses any default arguments.
  1608.   **
  1609.   ** ^RETURN-VALUE:
  1610. ***************
  1611. *** 1526,1532 ****
  1612.   **    <argd> should be an array of ARGDESCs declared using the CMD_XXXX macros
  1613.   **    or with the ENDOFARGS (and possible STARTOFARGS) macros.
  1614.   **
  1615. ! ** ^SIDE-EFECTS:
  1616.   **    Prints on stderr.
  1617.   **
  1618.   ** ^RETURN-VALUE:
  1619. --- 1532,1538 ----
  1620.   **    <argd> should be an array of ARGDESCs declared using the CMD_XXXX macros
  1621.   **    or with the ENDOFARGS (and possible STARTOFARGS) macros.
  1622.   **
  1623. ! ** ^SIDE-EFFECTS:
  1624.   **    Prints on stderr.
  1625.   **
  1626.   ** ^RETURN-VALUE:
  1627. ***************
  1628. *** 1615,1621 ****
  1629.   **    If mode is READ or READ+WRITE then the last argument should be the
  1630.   **    address of the desired object, otherwise it should be the object itself.
  1631.   **
  1632. ! ** ^SIDE-EFECTS:
  1633.   **    None if the mode is READ, otherwise, the desired attibutes are (re)set
  1634.   **
  1635.   ** ^RETURN-VALUE:
  1636. --- 1621,1627 ----
  1637.   **    If mode is READ or READ+WRITE then the last argument should be the
  1638.   **    address of the desired object, otherwise it should be the object itself.
  1639.   **
  1640. ! ** ^SIDE-EFFECTS:
  1641.   **    None if the mode is READ, otherwise, the desired attibutes are (re)set
  1642.   **
  1643.   ** ^RETURN-VALUE:
  1644. ***************
  1645. *** 1690,1696 ****
  1646.   
  1647.         /* now figure out what to do and go do it! */
  1648.      switch( cntl ) {
  1649. !       case  pc_ARGFLAGS :
  1650.            {
  1651.               register ARGDESC *ad, *args;
  1652.               char *name = VA_ARG( ap, char * );
  1653. --- 1696,1702 ----
  1654.   
  1655.         /* now figure out what to do and go do it! */
  1656.      switch( cntl ) {
  1657. !       case  pc_ARGFLAGS :  /* get/set arg-flags */
  1658.            {
  1659.               register ARGDESC *ad, *args;
  1660.               char *name = VA_ARG( ap, char * );
  1661. ***************
  1662. *** 1697,1702 ****
  1663. --- 1703,1709 ----
  1664.               int  *argflags;
  1665.               BOOL  is_match = FALSE;
  1666.   
  1667. +                /* first we have to find the argument whose flags we need */
  1668.               for (args = argd ; args  &&  !is_match ; args = cmd_defargs(args)) {
  1669.                  for (ad = ARG_FIRST(args) ; !ARG_isEND(ad) ; ARG_ADVANCE(ad)) {
  1670.                     if ( arg_type(ad) == argDummy )  continue;
  1671. ***************
  1672. *** 1713,1718 ****
  1673. --- 1720,1726 ----
  1674.                  return  pe_NOMATCH;
  1675.               }
  1676.   
  1677. +                /* now that we found it - retrieve the argument flags */
  1678.               if ( isREADING(mode) ) {
  1679.                 argflags = VA_ARG( ap, int * );
  1680.                 *argflags = (int) arg_flags(ad);
  1681. ***************
  1682. *** 1723,1732 ****
  1683.            }/*block*/
  1684.            break;
  1685.   
  1686. !       case  pc_PARSEFLAGS :
  1687.            {
  1688.               int *pflags, flags;
  1689.   
  1690.               if ( isREADING(mode) ) {
  1691.                 pflags = VA_ARG( ap, int * );
  1692.                 flags = (int) cmd_flags(cmd);
  1693. --- 1731,1741 ----
  1694.            }/*block*/
  1695.            break;
  1696.   
  1697. !       case  pc_PARSEFLAGS : /* get/set the parse-flags */
  1698.            {
  1699.               int *pflags, flags;
  1700.   
  1701. +                /* get value from call-stack (dependent on the mode) */
  1702.               if ( isREADING(mode) ) {
  1703.                 pflags = VA_ARG( ap, int * );
  1704.                 flags = (int) cmd_flags(cmd);
  1705. ***************
  1706. *** 1736,1750 ****
  1707.                 pflags = &flags;
  1708.               }
  1709.   
  1710.               if ( isWRITING(mode) )  cmd_flags(cmd) = (argMask_t) *pflags;
  1711.               if ( isREADING(mode) )  *pflags = flags;
  1712.            }/*block*/
  1713.            break;
  1714.   
  1715. !       case  pc_DEFARGS :
  1716.            {
  1717.               ARGDESC **pdefargd, *defargd;
  1718.   
  1719.               if ( isREADING(mode) ) {
  1720.                  pdefargd = VA_ARG( ap, ARGDESC ** );
  1721.                  defargd = cmd_defargs(cmd);
  1722. --- 1745,1761 ----
  1723.                 pflags = &flags;
  1724.               }
  1725.   
  1726. +                /* perform the desired action(s) */
  1727.               if ( isWRITING(mode) )  cmd_flags(cmd) = (argMask_t) *pflags;
  1728.               if ( isREADING(mode) )  *pflags = flags;
  1729.            }/*block*/
  1730.            break;
  1731.   
  1732. !       case  pc_DEFARGS : /* get/set the default arguments */
  1733.            {
  1734.               ARGDESC **pdefargd, *defargd;
  1735.   
  1736. +                /* get value from call-stack (dependent on the mode) */
  1737.               if ( isREADING(mode) ) {
  1738.                  pdefargd = VA_ARG( ap, ARGDESC ** );
  1739.                  defargd = cmd_defargs(cmd);
  1740. ***************
  1741. *** 1773,1784 ****
  1742.            }
  1743.            break;
  1744.   
  1745. !       case  pc_NAME :
  1746. !       case  pc_PURPOSE :
  1747. !       case  pc_DESCRIPTION :
  1748.            {
  1749.               CONST char *str, **pstr;
  1750.   
  1751.               if ( isREADING(mode) ) {
  1752.                  pstr = VA_ARG( ap, CONST char ** );
  1753.                  if      ( cntl == pc_NAME )        str = cmd_name(cmd);
  1754. --- 1784,1796 ----
  1755.            }
  1756.            break;
  1757.   
  1758. !       case  pc_NAME :  /* get/set name */
  1759. !       case  pc_PURPOSE :  /* get/set purpose */
  1760. !       case  pc_DESCRIPTION :  /* get/set description */
  1761.            {
  1762.               CONST char *str, **pstr;
  1763.   
  1764. +                /* get value from call-stack (dependent on the mode) */
  1765.               if ( isREADING(mode) ) {
  1766.                  pstr = VA_ARG( ap, CONST char ** );
  1767.                  if      ( cntl == pc_NAME )        str = cmd_name(cmd);
  1768. ***************
  1769. *** 1790,1795 ****
  1770. --- 1802,1808 ----
  1771.                  pstr = &str;
  1772.               }
  1773.   
  1774. +                /* perform the desired action(s) */
  1775.               if ( isWRITING(mode) )  {
  1776.                  if      ( cntl == pc_NAME )        cmd_name(cmd) = *pstr;
  1777.                  else if ( cntl == pc_PURPOSE )     cmd_purpose(cmd) = *pstr;
  1778. ***************
  1779. *** 1843,1849 ****
  1780.   ** ^REQUIREMENTS:
  1781.   **    <str> should be non-NULL and non-empty
  1782.   **
  1783. ! ** ^SIDE-EFECTS:
  1784.   **    <str> is modified by strsplit().
  1785.   **    <argd> is modified accordingly as arguments are matched.
  1786.   **
  1787. --- 1856,1862 ----
  1788.   ** ^REQUIREMENTS:
  1789.   **    <str> should be non-NULL and non-empty
  1790.   **
  1791. ! ** ^SIDE-EFFECTS:
  1792.   **    <str> is modified by strsplit().
  1793.   **    <argd> is modified accordingly as arguments are matched.
  1794.   **
  1795. ***************
  1796. *** 1937,1943 ****
  1797.   ** ^REQUIREMENTS:
  1798.   **    <fp> should be non-NULL, already opened-for-reading, file-pointer
  1799.   **
  1800. ! ** ^SIDE-EFECTS:
  1801.   **    <argd> is modified accordingly as arguments are matched.
  1802.   **
  1803.   ** ^RETURN-VALUE:
  1804. --- 1950,1956 ----
  1805.   ** ^REQUIREMENTS:
  1806.   **    <fp> should be non-NULL, already opened-for-reading, file-pointer
  1807.   **
  1808. ! ** ^SIDE-EFFECTS:
  1809.   **    <argd> is modified accordingly as arguments are matched.
  1810.   **
  1811.   ** ^RETURN-VALUE:
  1812. ***************
  1813. *** 2069,2075 ****
  1814.   ** ^REQUIREMENTS:
  1815.   **    <argls> should be an ArgList of strings
  1816.   **
  1817. ! ** ^SIDE-EFECTS:
  1818.   **    <argd> is modified accordingly as arguments are matched.
  1819.   **
  1820.   ** ^RETURN-VALUE:
  1821. --- 2082,2088 ----
  1822.   ** ^REQUIREMENTS:
  1823.   **    <argls> should be an ArgList of strings
  1824.   **
  1825. ! ** ^SIDE-EFFECTS:
  1826.   **    <argd> is modified accordingly as arguments are matched.
  1827.   **
  1828.   ** ^RETURN-VALUE:
  1829. ***************
  1830. *** 2118,2126 ****
  1831. --- 2131,2141 ----
  1832.         argv[i] = L_STRING(ls);
  1833.      }
  1834.   
  1835. +       /* parse the list */
  1836.      saveflags = cmd_flags(argd);
  1837.      BSET(cmd_flags(argd), pa_ARGV0);
  1838.      rc = parse_argv_style( argv, parse_init( &argd ) );
  1839. +    free( argv );
  1840.   
  1841.         /* scan for missing required arguments */
  1842.      if ( SYNTAX_ERROR(rc, argd) ) {
  1843. ***************
  1844. *** 2174,2180 ****
  1845.   **    the last argument would appear, then the NULL pointer will end the
  1846.   **    the list of arguments and argc is ignored.
  1847.   **    
  1848. ! ** ^SIDE-EFECTS:
  1849.   **    <argd> is modified accordingly as arguments are matched.
  1850.   **
  1851.   ** ^RETURN-VALUE:
  1852. --- 2189,2195 ----
  1853.   **    the last argument would appear, then the NULL pointer will end the
  1854.   **    the list of arguments and argc is ignored.
  1855.   **    
  1856. ! ** ^SIDE-EFFECTS:
  1857.   **    <argd> is modified accordingly as arguments are matched.
  1858.   **
  1859.   ** ^RETURN-VALUE:
  1860. ***************
  1861. *** 2217,2222 ****
  1862. --- 2232,2238 ----
  1863.      if ( !argv )  return  pe_SYSTEM;
  1864.      argv[ argc ] = CHARNULL;
  1865.   
  1866. +       /* assign the string into the array */
  1867.      VA_START(ap, argc);
  1868.      for ( i = 0; i < argc  &&  (arg = VA_ARG(ap, char *)) ; i++ ) {
  1869.         argv[i] = arg;
  1870. ***************
  1871. *** 2223,2229 ****
  1872. --- 2239,2247 ----
  1873.      }
  1874.      VA_END(ap);
  1875.   
  1876. +       /* parse the arguments */
  1877.      rc = parse_argv_style( argv, parse_init( &argd ) );
  1878. +    free( argv );
  1879.   
  1880.         /* scan for missing required arguments */
  1881.      if ( SYNTAX_ERROR(rc, argd) ) {
  1882. ***************
  1883. *** 2267,2273 ****
  1884.   ** ^REQUIREMENTS:
  1885.   **    <argv> must be non-NULL and have a NULL pointer as its last item.
  1886.   **
  1887. ! ** ^SIDE-EFECTS:
  1888.   **    <argd> is modified accordingly as arguments are matched.
  1889.   **
  1890.   ** ^RETURN-VALUE:
  1891. --- 2285,2291 ----
  1892.   ** ^REQUIREMENTS:
  1893.   **    <argv> must be non-NULL and have a NULL pointer as its last item.
  1894.   **
  1895. ! ** ^SIDE-EFFECTS:
  1896.   **    <argd> is modified accordingly as arguments are matched.
  1897.   **
  1898.   ** ^RETURN-VALUE:
  1899.