home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume26 / parseargs / patch09b < prev    next >
Text File  |  1991-11-25  |  20KB  |  611 lines

  1. Newsgroups: comp.sources.misc
  2. From: Brad Appleton <brad@hcx1.ssd.csd.harris.com>
  3. Subject:  v26i066:  parseargs - functions to parse command line arguments, Patch09b/2
  4. Message-ID: <1991Nov26.023515.26816@sparky.imd.sterling.com>
  5. X-Md4-Signature: 02ad4830d62790c0e43b254f7b67c5be
  6. Date: Tue, 26 Nov 1991 02:35:15 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Brad Appleton <brad@hcx1.ssd.csd.harris.com>
  10. Posting-number: Volume 26, Issue 66
  11. Archive-name: parseargs/patch09b
  12. Environment: UNIX, VMS, MS-DOS, OS/2, Amiga
  13. Patch-To: parseargs: Volume 17, Issue 46-57
  14.  
  15. #!/bin/sh
  16. # do not concatenate these parts, unpack them in order with /bin/sh
  17. # file PATCH09 continued
  18. #
  19. if test ! -r _shar_seq_.tmp; then
  20.     echo 'Please unpack part 1 first!'
  21.     exit 1
  22. fi
  23. (read Scheck
  24.  if test "$Scheck" != 2; then
  25.     echo Please unpack part "$Scheck" next!
  26.     exit 1
  27.  else
  28.     exit 0
  29.  fi
  30. ) < _shar_seq_.tmp || exit 1
  31. if test ! -f _shar_wnt_.tmp; then
  32.     echo 'x - still skipping PATCH09'
  33. else
  34. echo 'x - continuing file PATCH09'
  35. sed 's/^X//' << 'SHAR_EOF' >> 'PATCH09' &&
  36. X  **    ProgName (which is initially NULL) will be used to point to the
  37. X  **    command-name (specified on the command-line) of the command that
  38. X  **    has most recently invoked a function in the parseargs library.
  39. + **    ProgNameLen will be set to the length of the string.
  40. X  ***^^**********************************************************************/
  41. X  CONST char *ProgName = CHARNULL;
  42. + int ProgNameLen = 0;
  43. X  
  44. X  EXTERN  VOID  syserr   ARGS((const char *, ...));
  45. X  EXTERN  VOID  usrerr   ARGS((const char *, ...));
  46. ***************
  47. *** 195,201 ****
  48. X  
  49. X  
  50. X  /* override argument descriptor, if none given by user */
  51. ! static ARGDESC    Empty_ArgDesc[] = { START_ARGUMENTS, END_ARGUMENTS };
  52. X  
  53. X  /***************************************************************************
  54. X  ** ^SECTION: DEFAULT-ARGUMENTS
  55. --- 206,212 ----
  56. X  
  57. X  
  58. X  /* override argument descriptor, if none given by user */
  59. ! static ARGDESC  Empty_ArgDesc[] = { START_ARGUMENTS, END_ARGUMENTS };
  60. X  
  61. X  /***************************************************************************
  62. X  ** ^SECTION: DEFAULT-ARGUMENTS
  63. ***************
  64. *** 387,479 ****
  65. X  
  66. X  
  67. X  /***************************************************************************
  68. - ** ^FUNCTION: get_description - get the description portion of a string
  69. - **
  70. - ** ^SYNOPSIS:
  71. - */
  72. - #ifndef __ANSI_C__
  73. -    static char *get_description( str )
  74. - /*
  75. - ** ^PARAMETERS:
  76. - */
  77. -    char *str;
  78. - /*    -- the string to parse for a description
  79. - */
  80. - #endif  /* !__ANSI_C__ */
  81. - /* ^DESCRIPTION:
  82. - **    Get_description null terminates the first portion of the string and
  83. - **    returns a pointer to the second portion.
  84. - **
  85. - **    Two "portions" must be either separated by whitespace or the second
  86. - **    portion may be within "(),{},[], or <>" delimiters. The second
  87. - **    portion is assumed to begin with the first alphabetic following
  88. - **    separator.
  89. - **
  90. - ** ^REQUIREMENTS:
  91. - **    str should be non-null and non-empty
  92. - **
  93. - ** ^SIDE-EFFECTS:
  94. - **    The characters which separated the two portions of <str> are
  95. - **    replaced with a single '\0'.
  96. - **
  97. - ** ^RETURN-VALUE:
  98. - **    Address of the description (or NULL if the string has no description).
  99. - **
  100. - ** ^ALGORITHM:
  101. - **    - locate the end of the first portion by scanning for whitespace or
  102. - **      balanced delimiters.
  103. - **    - locate the beginning of the second portion by scanning for the first
  104. - **      alpha-numeric following the end of the first portion.
  105. - **    - return the address of the description.
  106. - ***^^**********************************************************************/
  107. - #ifdef __ANSI_C__
  108. -    static char *get_description( char *str )
  109. - #endif
  110. - {
  111. -    register char  *description = CHARNULL;
  112. -    BOOL  is_end = FALSE, is_balanced = FALSE;
  113. -    char  *p;
  114. -    static CONST char  whitespace[]  = " \t\n\r\f\v";
  115. -    static CONST char  beg_portion[] = "(<{[";
  116. -    static CONST char  end_portion[] = ")>}]";
  117. -    description = strpbrk( str, whitespace );
  118. -    if ( description ) {
  119. -       is_end = TRUE;
  120. -       *description++ = '\0';  /* null terminate the 1st portion */
  121. -       while ( isspace(*description) )  ++description;  /* trim leading ' ' */
  122. -    }
  123. -    if ( !is_end ) {
  124. -        p = strpbrk( str, beg_portion );
  125. -        if ( p )  description = p;
  126. -    }
  127. -    if ( description ) {
  128. -       if ( !is_end ) {  /* null terminate and skip leading '(' */
  129. -          is_end = is_balanced = TRUE;
  130. -          *description++ = '\0';
  131. -       }
  132. -       else if ( strchr(beg_portion, *description) ) {
  133. -             is_balanced = TRUE;
  134. -             ++description;
  135. -       }
  136. -       if ( is_balanced ) {  /* remove trailing ')' */
  137. -          p = description + (strlen( description ) - 1);
  138. -          if ( strchr(end_portion, *p) )  *p = '\0';
  139. -       }
  140. -    }/*end-if*/
  141. -    if ( description  &&  !is_balanced ) {
  142. -       while ( !isalnum(*description) )  ++description;
  143. -    }
  144. -    return  description;
  145. - }
  146. - /***************************************************************************
  147. X  ** ^FUNCTION: init_args - Initialize the command object
  148. X  **
  149. X  ** ^SYNOPSIS:
  150. --- 398,403 ----
  151. ***************
  152. *** 522,527 ****
  153. --- 446,452 ----
  154. X     int  ad_count = 0;
  155. X     BOOL old_style = FALSE;
  156. X     char *description = CHARNULL, *purpose = CHARNULL;
  157. +    int  desclen;
  158. X  
  159. X     if ( !argd )  return;
  160. X  
  161. ***************
  162. *** 542,556 ****
  163. X        if (ARG_isBOOLEAN(ad) || ARG_isPSEUDOARG(ad))
  164. X           BSET( arg_flags(ad), ARGNOVAL );
  165. X  
  166. ! #ifdef UNWRITABLE_STRING_LITERALS
  167. !       ad->ad_prompt = strdup( ad->ad_prompt );
  168. ! #endif
  169. !       description = get_description( (char *)arg_sname(ad) );
  170. !       if ( description )  {
  171. X           BSET(arg_flags(ad), ARGDESCRIBED);
  172. -          strcpy( (char *)arg_sdesc(ad), description );
  173. -       }
  174. X     }
  175. X  
  176. X        /* shift all the entries down one to make room for a new 1st-entry
  177. --- 467,474 ----
  178. X        if (ARG_isBOOLEAN(ad) || ARG_isPSEUDOARG(ad))
  179. X           BSET( arg_flags(ad), ARGNOVAL );
  180. X  
  181. !       if ( get_argdesc( (char *)arg_sname(ad), &desclen ) )
  182. X           BSET(arg_flags(ad), ARGDESCRIBED);
  183. X     }
  184. X  
  185. X        /* shift all the entries down one to make room for a new 1st-entry
  186. ***************
  187. *** 580,592 ****
  188. X     }
  189. X  #endif
  190. X  
  191. ! #ifdef UNWRITABLE_STRING_LITERALS
  192. !    cmd_name(argd) = strdup( cmd_name(argd) );
  193. ! #endif
  194. X       /* if new-style, get the purpose from the command name */
  195. X     if ( !old_style  &&  cmd_name(argd) ) {
  196. !       purpose = get_description( (char *)cmd_name(argd) );
  197. X     }
  198. X  
  199. X        /* set the program name */
  200. --- 498,507 ----
  201. X     }
  202. X  #endif
  203. X  
  204. !    if ( cmd_name(argd) )  cmd_name(argd) = strdup( cmd_name(argd) );
  205. X       /* if new-style, get the purpose from the command name */
  206. X     if ( !old_style  &&  cmd_name(argd) ) {
  207. !       purpose = cmd_name(argd);
  208. X     }
  209. X  
  210. X        /* set the program name */
  211. ***************
  212. *** 1244,1250 ****
  213. X  
  214. X     /* the combination of parse-flags that may be set via $PARSECNTL */
  215. X  #define  pa_USRFLAGS \
  216. !     (pa_PROMPT|pa_IGNORE|pa_ANYCASE|pa_OPTSONLY|pa_KWDSONLY|pa_FLAGS1ST)
  217. X  
  218. X  #ifdef __ANSI_C__
  219. X     static void get_parse_flags( ARGDESC *cmd )
  220. --- 1159,1165 ----
  221. X  
  222. X     /* the combination of parse-flags that may be set via $PARSECNTL */
  223. X  #define  pa_USRFLAGS \
  224. !    (pa_PROMPT|pa_IGNORE|pa_ANYCASE|pa_OPTSONLY|pa_KWDSONLY|pa_FLAGS1ST)
  225. X  
  226. X  #ifdef __ANSI_C__
  227. X     static void get_parse_flags( ARGDESC *cmd )
  228. ***************
  229. *** 1379,1385 ****
  230. X     if ( BTEST(cmd_state(cmd), ps_NOCMDENV) )  return;
  231. X  
  232. X        /* build the name of the environment variable */
  233. !    strucpy( env_name, ProgName );
  234. X     strcat( env_name, ENV_SUFFIX );
  235. X  
  236. X        /* get the value of the environment variable,
  237. --- 1294,1302 ----
  238. X     if ( BTEST(cmd_state(cmd), ps_NOCMDENV) )  return;
  239. X  
  240. X        /* build the name of the environment variable */
  241. !    strncpy( env_name, ProgName, ProgNameLen );
  242. !    env_name[ProgNameLen] = 0;
  243. !    (VOID) strupr( env_name );
  244. X     strcat( env_name, ENV_SUFFIX );
  245. X  
  246. X        /* get the value of the environment variable,
  247. ***************
  248. *** 1400,1405 ****
  249. --- 1317,1326 ----
  250. X           return;
  251. X        }
  252. X  
  253. + #ifdef vms_style
  254. +       BSET( cmd_state(cmd), ps_NOTCMDLINE );
  255. + #endif
  256. X        rc = parse_argv_style( argv, cmd );
  257. X        free( argv );
  258. X        cmd_list(cmd) = ARGDESCNULL;  /* dont allow lists to continue on */
  259. ***************
  260. *** 1407,1416 ****
  261. X        cmd_prev(cmd) = ARGDESCNULL;
  262. X  #endif
  263. X  
  264. X           /* check for errors */
  265. X        if ( rc  &&  !BTEST(cmd_flags(cmd), pa_IGNORE) ) {
  266. !          eprintf( "%s: syntax-error in %s \"%s\".\n",
  267. !                   ProgName, USER_VARIABLE, env_name );
  268. X           eprintf( "\t%s = \"%s\"\n\n", env_name, env_args );
  269. X           free( env_val );
  270. X           usage( cmd );
  271. --- 1328,1341 ----
  272. X        cmd_prev(cmd) = ARGDESCNULL;
  273. X  #endif
  274. X  
  275. + #ifdef vms_style
  276. +       BCLEAR( cmd_state(cmd), ps_NOTCMDLINE );
  277. + #endif
  278. X           /* check for errors */
  279. X        if ( rc  &&  !BTEST(cmd_flags(cmd), pa_IGNORE) ) {
  280. !          eprintf( "%.*s: syntax-error in %s \"%s\".\n",
  281. !                   ProgNameLen, ProgName, USER_VARIABLE, env_name );
  282. X           eprintf( "\t%s = \"%s\"\n\n", env_name, env_args );
  283. X           free( env_val );
  284. X           usage( cmd );
  285. ***************
  286. *** 1451,1457 ****
  287. X  **    macros or with the ENDOFARGS (and possible STARTOFARGS) macros.
  288. X  **
  289. X  ** ^SIDE-EFFECTS:
  290. ! **      Initialize argd and parses any default arguments.
  291. X  **
  292. X  ** ^RETURN-VALUE:
  293. X  **    pointer to the arg-descriptors
  294. --- 1376,1382 ----
  295. X  **    macros or with the ENDOFARGS (and possible STARTOFARGS) macros.
  296. X  **
  297. X  ** ^SIDE-EFFECTS:
  298. ! **    Initialize argd and parses any default arguments.
  299. X  **
  300. X  ** ^RETURN-VALUE:
  301. X  **    pointer to the arg-descriptors
  302. ***************
  303. *** 1481,1489 ****
  304. --- 1406,1416 ----
  305. X        /* save the name of this program (for error messages) */
  306. X     if ( cmd_argv0(cmd)  &&  *(cmd_argv0(cmd)) ) {
  307. X        ProgName = cmd_argv0(cmd);
  308. +       ProgNameLen = get_argpfx(ProgName);
  309. X     }
  310. X     else if ( cmd_name(cmd)  &&  *(cmd_name(cmd)) ) {
  311. X        ProgName = cmd_name(cmd);
  312. +       ProgNameLen = get_argpfx(ProgName);
  313. X     }
  314. X     else {
  315. X        unnamed = TRUE;
  316. ***************
  317. *** 1559,1567 ****
  318. --- 1486,1496 ----
  319. X  
  320. X     if ( cmd_argv0(cmd) && *(cmd_argv0(cmd)) ) {
  321. X        ProgName = cmd_argv0(cmd);
  322. +       ProgNameLen = get_argpfx(ProgName);
  323. X     }
  324. X     else if ( cmd_name(cmd) && *(cmd_name(cmd)) ) {
  325. X        ProgName = cmd_name(cmd);
  326. +       ProgNameLen = get_argpfx(ProgName);
  327. X     }
  328. X  
  329. X     usg_ctl = get_usage_flags(cmd);
  330. ***************
  331. *** 1700,1706 ****
  332. X           {
  333. X              register ARGDESC *ad, *args;
  334. X              char *name = VA_ARG( ap, char * );
  335. !             int  *argflags;
  336. X              BOOL  is_match = FALSE;
  337. X  
  338. X                 /* first we have to find the argument whose flags we need */
  339. --- 1629,1635 ----
  340. X           {
  341. X              register ARGDESC *ad, *args;
  342. X              char *name = VA_ARG( ap, char * );
  343. !             argMask_t  *argflags;
  344. X              BOOL  is_match = FALSE;
  345. X  
  346. X                 /* first we have to find the argument whose flags we need */
  347. ***************
  348. *** 1722,1729 ****
  349. X  
  350. X                 /* now that we found it - retrieve the argument flags */
  351. X              if ( isREADING(mode) ) {
  352. !               argflags = VA_ARG( ap, int * );
  353. !               *argflags = (int) arg_flags(ad);
  354. X              }
  355. X              else {
  356. X                rc = pe_BADMODE;  /* parsecntl() wont set ARGFLAGS */
  357. --- 1651,1658 ----
  358. X  
  359. X                 /* now that we found it - retrieve the argument flags */
  360. X              if ( isREADING(mode) ) {
  361. !               argflags = VA_ARG( ap, argMask_t * );
  362. !               *argflags = arg_flags(ad);
  363. X              }
  364. X              else {
  365. X                rc = pe_BADMODE;  /* parsecntl() wont set ARGFLAGS */
  366. ***************
  367. *** 1733,1752 ****
  368. X  
  369. X        case  pc_PARSEFLAGS : /* get/set the parse-flags */
  370. X           {
  371. !             int *pflags, flags;
  372. X  
  373. X                 /* get value from call-stack (dependent on the mode) */
  374. X              if ( isREADING(mode) ) {
  375. !               pflags = VA_ARG( ap, int * );
  376. !               flags = (int) cmd_flags(cmd);
  377. X              }
  378. X              else {
  379. !               flags = VA_ARG( ap, int );
  380. X                pflags = &flags;
  381. X              }
  382. X  
  383. X                 /* perform the desired action(s) */
  384. !             if ( isWRITING(mode) )  cmd_flags(cmd) = (argMask_t) *pflags;
  385. X              if ( isREADING(mode) )  *pflags = flags;
  386. X           }/*block*/
  387. X           break;
  388. --- 1662,1681 ----
  389. X  
  390. X        case  pc_PARSEFLAGS : /* get/set the parse-flags */
  391. X           {
  392. !             argMask_t *pflags, flags;
  393. X  
  394. X                 /* get value from call-stack (dependent on the mode) */
  395. X              if ( isREADING(mode) ) {
  396. !               pflags = VA_ARG( ap, argMask_t * );
  397. !               flags = cmd_flags(cmd);
  398. X              }
  399. X              else {
  400. !               flags = (argMask_t) VA_ARG( ap, int );
  401. X                pflags = &flags;
  402. X              }
  403. X  
  404. X                 /* perform the desired action(s) */
  405. !             if ( isWRITING(mode) )  cmd_flags(cmd) = *pflags;
  406. X              if ( isREADING(mode) )  *pflags = flags;
  407. X           }/*block*/
  408. X           break;
  409. ***************
  410. *** 1793,1800 ****
  411. X                 /* get value from call-stack (dependent on the mode) */
  412. X              if ( isREADING(mode) ) {
  413. X                 pstr = VA_ARG( ap, CONST char ** );
  414. !                if      ( cntl == pc_NAME )        str = cmd_name(cmd);
  415. !                else if ( cntl == pc_PURPOSE )     str = cmd_purpose(cmd);
  416. X                 else /* cntl == pc_DESCRIPTION */  str = cmd_description(cmd);
  417. X              }
  418. X              else {
  419. --- 1722,1768 ----
  420. X                 /* get value from call-stack (dependent on the mode) */
  421. X              if ( isREADING(mode) ) {
  422. X                 pstr = VA_ARG( ap, CONST char ** );
  423. !                if      ( cntl == pc_NAME ) {
  424. !                   if ( !BTEST(cmd_state(cmd), ps_USERNAME|ps_FREENAME) ) {
  425. !                      if ( cmd_name(argd) ) {
  426. !                         int  n;
  427. !                         char  *p;
  428. !                         n = get_argpfx( (char *)cmd_name(argd) );
  429. !                         p = (char *)malloc( n+1 );
  430. !                         if ( !p ) {
  431. !                            syserr( "malloc failed in parsecntl()" );
  432. !                         }
  433. !                         strncpy(p, (char *)cmd_name(argd), n);
  434. !                         p[n] = 0;
  435. !                         cmd_name(argd) = p;
  436. !                         BSET(cmd_state(cmd), ps_FREENAME);
  437. !                      }
  438. !                   }
  439. !                   str = cmd_name(cmd);
  440. !                }
  441. !                else if ( cntl == pc_PURPOSE ) {
  442. !                   if ( !BTEST(cmd_state(cmd), ps_USERPURPOSE|ps_FREEPURPOSE) ) {
  443. !                      if ( cmd_purpose(argd) ) {
  444. !                         int  n;
  445. !                         char  *p, *q;
  446. !                         p = get_argdesc( (char *)cmd_purpose(argd), &n );
  447. !                         if ( p ) {
  448. !                            q = (char *)malloc( n+1 );
  449. !                            if ( !q ) {
  450. !                               syserr( "malloc failed in parsecntl()" );
  451. !                            }
  452. !                            strncpy(q, p, n);
  453. !                            q[n] = 0;
  454. !                            p = q;
  455. !                            BSET(cmd_state(cmd), ps_FREEPURPOSE);
  456. !                         }
  457. !                         cmd_purpose(cmd) = p;
  458. !                      }
  459. !                   }
  460. !                   str = cmd_purpose(cmd);
  461. !                }
  462. X                 else /* cntl == pc_DESCRIPTION */  str = cmd_description(cmd);
  463. X              }
  464. X              else {
  465. ***************
  466. *** 1804,1811 ****
  467. X  
  468. X                 /* perform the desired action(s) */
  469. X              if ( isWRITING(mode) )  {
  470. !                if      ( cntl == pc_NAME )        cmd_name(cmd) = *pstr;
  471. !                else if ( cntl == pc_PURPOSE )     cmd_purpose(cmd) = *pstr;
  472. X                 else /* cntl == pc_DESCRIPTION */  cmd_description(cmd) = *pstr;
  473. X              }
  474. X              if ( isREADING(mode) )  *pstr = str;
  475. --- 1772,1792 ----
  476. X  
  477. X                 /* perform the desired action(s) */
  478. X              if ( isWRITING(mode) )  {
  479. !                if ( cntl == pc_NAME ) {
  480. !                   if ( BTEST(cmd_state(cmd), ps_FREENAME) )
  481. !                      free( cmd_name(cmd) );
  482. !                      BCLEAR( cmd_state(cmd), ps_FREENAME );
  483. !                      BSET( cmd_state(cmd), ps_USERNAME );
  484. !                      cmd_name(cmd) = *pstr;
  485. !                   }
  486. !                else if ( cntl == pc_PURPOSE ) {
  487. !                   if ( BTEST(cmd_state(cmd), ps_FREEPURPOSE) ) {
  488. !                      free( cmd_purpose(cmd) );
  489. !                   }
  490. !                   BCLEAR( cmd_state(cmd), ps_FREEPURPOSE );
  491. !                   BSET( cmd_state(cmd), ps_USERPURPOSE );
  492. !                   cmd_purpose(cmd) = *pstr;
  493. !                }
  494. X                 else /* cntl == pc_DESCRIPTION */  cmd_description(cmd) = *pstr;
  495. X              }
  496. X              if ( isREADING(mode) )  *pstr = str;
  497. ***************
  498. *** 1896,1909 ****
  499. X     BSET(cmd_flags(argd), pa_ARGV0);
  500. X  
  501. X        /* split line up into whitespace separated tokens */
  502. !    if ( !strsplit( &argv, str, CHARNULL ) ) {
  503. !       free( argv );
  504. !       return  rc;
  505. !    }
  506. X  
  507. X     rc = parse_argv_style( argv, parse_init( &argd ) );
  508. X     free( argv );
  509. X  
  510. X        /* scan for missing required arguments */
  511. X     if ( SYNTAX_ERROR(rc, argd) ) {
  512. X        fputc( '\n', stderr );
  513. --- 1877,1895 ----
  514. X     BSET(cmd_flags(argd), pa_ARGV0);
  515. X  
  516. X        /* split line up into whitespace separated tokens */
  517. !    (void) strsplit( &argv, str, CHARNULL );
  518. X  
  519. + #ifdef vms_style
  520. +    BSET( cmd_state(argd), ps_NOTCMDLINE );
  521. + #endif
  522. X     rc = parse_argv_style( argv, parse_init( &argd ) );
  523. X     free( argv );
  524. X  
  525. + #ifdef vms_style
  526. +    BCLEAR( cmd_state(argd), ps_NOTCMDLINE );
  527. + #endif
  528. X        /* scan for missing required arguments */
  529. X     if ( SYNTAX_ERROR(rc, argd) ) {
  530. X        fputc( '\n', stderr );
  531. ***************
  532. *** 2131,2136 ****
  533. --- 2117,2126 ----
  534. X        argv[i] = L_STRING(ls);
  535. X     }
  536. X  
  537. + #ifdef vms_style
  538. +    BSET( cmd_state(argd), ps_NOTCMDLINE );
  539. + #endif
  540. X        /* parse the list */
  541. X     saveflags = cmd_flags(argd);
  542. X     BSET(cmd_flags(argd), pa_ARGV0);
  543. ***************
  544. *** 2137,2142 ****
  545. --- 2127,2136 ----
  546. X     rc = parse_argv_style( argv, parse_init( &argd ) );
  547. X     free( argv );
  548. X  
  549. + #ifdef vms_style
  550. +    BCLEAR( cmd_state(argd), ps_NOTCMDLINE );
  551. + #endif
  552. X        /* scan for missing required arguments */
  553. X     if ( SYNTAX_ERROR(rc, argd) ) {
  554. X        fputc( '\n', stderr );
  555. ***************
  556. *** 2239,2247 ****
  557. --- 2233,2249 ----
  558. X     }
  559. X     VA_END(ap);
  560. X  
  561. + #ifdef vms_style
  562. +    BSET( cmd_state(argd), ps_NOTCMDLINE );
  563. + #endif
  564. X        /* parse the arguments */
  565. X     rc = parse_argv_style( argv, parse_init( &argd ) );
  566. X     free( argv );
  567. + #ifdef vms_style
  568. +    BCLEAR( cmd_state(argd), ps_NOTCMDLINE );
  569. + #endif
  570. X  
  571. X        /* scan for missing required arguments */
  572. X     if ( SYNTAX_ERROR(rc, argd) ) {
  573. SHAR_EOF
  574. echo 'File PATCH09 is complete' &&
  575. chmod 0664 PATCH09 ||
  576. echo 'restore of PATCH09 failed'
  577. Wc_c="`wc -c < 'PATCH09'`"
  578. test 66669 -eq "$Wc_c" ||
  579.     echo 'PATCH09: original size 66669, current size' "$Wc_c"
  580. rm -f _shar_wnt_.tmp
  581. fi
  582. rm -f _shar_seq_.tmp
  583. echo You have unpacked the last part
  584. exit 0
  585. exit 0 # Just in case...
  586. -- 
  587. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  588. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  589. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  590. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  591.