[Liblas-commits] r1319 - branches/1.2/apps

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Jul 27 13:12:49 EDT 2009


Author: hobu
Date: Mon Jul 27 13:12:49 2009
New Revision: 1319
URL: http://liblas.org/changeset/1319

Log:
fix #144 so unnamed arguments are so position sensitive

Modified:
   branches/1.2/apps/las2las.c
   branches/1.2/apps/las2txt.c
   branches/1.2/apps/lasinfo.c
   branches/1.2/apps/txt2las.c

Modified: branches/1.2/apps/las2las.c
==============================================================================
--- branches/1.2/apps/las2las.c	(original)
+++ branches/1.2/apps/las2las.c	Mon Jul 27 13:12:49 2009
@@ -273,15 +273,11 @@
         {
             remove_extra_header = TRUE;
         }
-        else if (i == argc - 2 && file_name_in == NULL && file_name_out == NULL)
+        else if (file_name_in == NULL && file_name_out == NULL)
         {
             file_name_in = argv[i];
         }
-        else if (i == argc - 1 && file_name_in == NULL && file_name_out == NULL)
-        {
-            file_name_in = argv[i];
-        }
-        else if (i == argc - 1 && file_name_in != NULL && file_name_out == NULL)
+        else if (file_name_in != NULL && file_name_out == NULL)
         {
             file_name_out = argv[i];
         }

Modified: branches/1.2/apps/las2txt.c
==============================================================================
--- branches/1.2/apps/las2txt.c	(original)
+++ branches/1.2/apps/las2txt.c	Mon Jul 27 13:12:49 2009
@@ -266,15 +266,11 @@
             i++;
             file_name_out = argv[i];
         }
-        else if (i == argc - 2 && file_name_in == 0 && file_name_out == 0)
+        else if (file_name_in == 0 && file_name_out == 0)
         {
             file_name_in = argv[i];
         }
-        else if (i == argc - 1 && file_name_in == 0 && file_name_out == 0)
-        {
-            file_name_in = argv[i];
-        }
-        else if (i == argc - 1 && file_name_in && file_name_out == 0)
+        else if (file_name_in && file_name_out == 0)
         {
             file_name_out = argv[i];
         }

Modified: branches/1.2/apps/lasinfo.c
==============================================================================
--- branches/1.2/apps/lasinfo.c	(original)
+++ branches/1.2/apps/lasinfo.c	Mon Jul 27 13:12:49 2009
@@ -204,7 +204,7 @@
         {
             skip_vlr = TRUE;
         }            
-        else if (i == argc - 1 && file_name == NULL)
+        else if (file_name == NULL)
         {
             file_name = argv[i];
         } 

Modified: branches/1.2/apps/txt2las.c
==============================================================================
--- branches/1.2/apps/txt2las.c	(original)
+++ branches/1.2/apps/txt2las.c	Mon Jul 27 13:12:49 2009
@@ -512,22 +512,13 @@
             i++;
             file_creation_year = (unsigned short)atoi(argv[i]);
         }
-        else if (   i == argc - 2 
-                    && file_name_in == NULL && 
+        else if (   file_name_in == NULL && 
                     file_name_out == NULL
                 )
         {
             file_name_in = argv[i];
         }
-        else if (   i == argc - 1 && 
-                    file_name_in == NULL && 
-                    file_name_out == NULL
-                )
-        {
-            file_name_in = argv[i];
-        }
-        else if (   i == argc - 1 && 
-                    file_name_in && 
+        else if (   file_name_in && 
                     file_name_out == NULL
                 )
         {


More information about the Liblas-commits mailing list