OSSP CVS Repository

ossp - Difference in ossp-pkg/rc/rc_optimpl.c versions 1.4 and 1.5
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/rc/rc_optimpl.c 1.4 -> 1.5

--- rc_optimpl.c 2002/03/26 17:11:06     1.4
+++ rc_optimpl.c 2002/04/08 15:37:10     1.5
@@ -57,7 +57,6 @@
 rc_return_t coptParse(int argc, char *argv[])
 {
     ex_t Except;
-    int  bCaught = 0;
     char cOpt = 0;              /* For argument parsing           */
     char *szCLIBuf = NULL;
     popt_context optCon;        /* Context for parsing options    */
@@ -105,7 +104,7 @@
     optCon = popt_getcontext(NULL, argc, (const char **)argv, optionsTable, 0);
     popt_setotheroptionhelp(optCon, "[options] <rcfile> <sections [args]>");
 
-    if (argc < 2) {
+    if (argc < 3) {
         popt_printusage(optCon, stderr, 0);
         return(RC_THROW(RC_ERR_USE));
     }
@@ -119,13 +118,11 @@
         if ((rc_return_t)Except.ex_value != RC_ERR_USE)
             fprintf(stderr, "Nonusage exception: %d\n",\
                 (rc_return_t)Except.ex_value);
-        bCaught = 1;
+
         fprintf(stderr, "Class '%s' threw exception %d in %s:%s():%d.\n",\
                 (char *)Except.ex_class, *(int *)Except.ex_value,\
                 Except.ex_file, Except.ex_func, Except.ex_line);
     }
-    if (!bCaught)
-        fprintf(stderr, "parseOpts: No exceptions caught.\n");
 
     szCLIBuf = (char *)popt_getarg(optCon);
     if ((szCLIBuf == NULL)) {
@@ -142,7 +139,7 @@
         return(RC_THROW(RC_ERR_INT));
     }
 
-    fprintf(stderr, "\nRun these commands: %s\n", szCLIBuf);
+    fprintf(stderr, "Run these commands: %s\n", szCLIBuf);
     popt_freecontext(optCon);
     return(RC_THROW(RC_OK));
 }

CVSTrac 2.0.1