]> git.sur5r.net Git - cc65/commitdiff
Merge pull request #203 from greg-king5/multi-comments
authorOliver Schmidt <ol.sc@web.de>
Mon, 31 Aug 2015 15:36:02 +0000 (17:36 +0200)
committerOliver Schmidt <ol.sc@web.de>
Mon, 31 Aug 2015 15:36:02 +0000 (17:36 +0200)
Change multi-line C comments in files that were missed by a previous pull request.

src/common/cmdline.c
src/common/cmdline.h

index 716df1efb3331fb00f4369ad7a0f14050905934d..0f6622934beabc03d002bad0ce35cdac7cc4663a 100644 (file)
@@ -161,7 +161,7 @@ static void ExpandFile (CmdLine* L, const char* Name)
 
 
 
-void InitCmdLine (int* aArgCount, char** aArgVec[], const char* aProgName)
+void InitCmdLine (int* aArgCount, char*** aArgVec, const char* aProgName)
 /* Initialize command line parsing. aArgVec is the argument array terminated by
 ** a NULL pointer (as usual), ArgCount is the number of valid arguments in the
 ** array. Both arguments are remembered in static storage.
@@ -171,7 +171,7 @@ void InitCmdLine (int* aArgCount, char** aArgVec[], const char* aProgName)
     int         I;
 
     /* Get the program name from argv[0] but strip a path */
-    if (*(aArgVec)[0] == 0) {
+    if ((*aArgVec)[0] == 0) {
         /* Use the default name given */
         ProgName = aProgName;
     } else {
@@ -190,7 +190,7 @@ void InitCmdLine (int* aArgCount, char** aArgVec[], const char* aProgName)
     ** special handling for arguments preceeded by the '@' sign - these are
     ** actually files containing arguments.
     */
-    for (I = 0; I < *aArgCount; ++I) {
+    for (I = 0; I <= *aArgCount; ++I) {
 
         /* Get the next argument */
         char* Arg = (*aArgVec)[I];
@@ -210,11 +210,11 @@ void InitCmdLine (int* aArgCount, char** aArgVec[], const char* aProgName)
     }
 
     /* Store the new argument list in a safe place... */
-    ArgCount = L.Count;
+    ArgCount = L.Count - 1;
     ArgVec   = L.Vec;
 
     /* ...and pass back the changed data also */
-    *aArgCount = L.Count;
+    *aArgCount = L.Count - 1;
     *aArgVec   = L.Vec;
 }
 
index b18906c7a1b01d65ce093533d05edd5987c314e6..1caf0cfb64dbe651af68f652c959bdd7a8a0d4ca 100644 (file)
@@ -71,7 +71,7 @@ struct LongOpt {
 
 
 
-void InitCmdLine (int* aArgCount, char** aArgVec[], const char* aProgName);
+void InitCmdLine (int* aArgCount, char*** aArgVec, const char* aProgName);
 /* Initialize command line parsing. aArgVec is the argument array terminated by
 ** a NULL pointer (as usual), ArgCount is the number of valid arguments in the
 ** array. Both arguments are remembered in static storage.