[geos-commits] [SCM] GEOS branch main updated. 4a7fd4c5c726441ecf47be31f1654a803eac52a2

git at osgeo.org git at osgeo.org
Mon Oct 18 15:08:03 PDT 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, main has been updated
       via  4a7fd4c5c726441ecf47be31f1654a803eac52a2 (commit)
       via  f9a224287036b8dac449b2775e01b2ac2a3553f3 (commit)
      from  655aacfea244e9ab0c57d96312522a4b5ac636af (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4a7fd4c5c726441ecf47be31f1654a803eac52a2
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Oct 19 00:07:09 2021 +0200

    Do not terminate() upon receiving non-numeric second positional arg
    
    References #1126

diff --git a/util/geosop/GeosOp.cpp b/util/geosop/GeosOp.cpp
index 483b3a3ca..c611dbe46 100644
--- a/util/geosop/GeosOp.cpp
+++ b/util/geosop/GeosOp.cpp
@@ -125,6 +125,10 @@ int main(int argc, char** argv) {
     {
         auto& v = result["opArgs"].as<std::vector<std::string>>();
         if (v.size() >= 1) {
+            if ( v.size() > 1 )
+            {
+                std::cerr << "positional arguments after the second one are discarded" << std::endl;
+            }
             auto val = v[0];
             /**
              * To get around cmdline parset limitation for parsing neg numbers,
@@ -133,7 +137,15 @@ int main(int argc, char** argv) {
             if (startsWith(val, "N")) {
                 val = val.substr(1, val.size()-1);
             }
-            cmdArgs.opArg1 = std::stod(val);
+            try {
+                cmdArgs.opArg1 = std::stod(val);
+            } catch (const std::invalid_argument&) {
+                std::cerr << "Invalid positional argument '" << val << "' (expected number)" << std::endl;
+                exit(1);
+            } catch (const std::out_of_range&) {
+                std::cerr << "Out of range positional argument '" << val << "' (expected double)" << std::endl;
+                exit(1);
+            }
         }
     }
 

commit f9a224287036b8dac449b2775e01b2ac2a3553f3
Author: Sandro Santilli <strk at kbt.io>
Date:   Mon Oct 18 23:40:01 2021 +0200

    Add --enable-debug support in the configure wrapper

diff --git a/configure b/configure
index 811a09b94..f39e9edac 100755
--- a/configure
+++ b/configure
@@ -8,12 +8,12 @@ which cmake > /dev/null 2>&1 || {
 srcdir=$(dirname $0)
 
 usage() {
-  echo "$0 [--prefix=<prefix>] [--help]"
+  echo "$0 [--prefix=<prefix>] [--enable-debug] [--help]"
 }
 
 cmd=cmake
 
-options=$(getopt -l "help,prefix:" "" "$@")
+options=$(getopt -l "help,enable-debug,prefix:" "" "$@")
 #echo XXXX ${options}
 eval set -- "$options"
 
@@ -23,6 +23,9 @@ while true; do
       shift
       cmd="${cmd} -DCMAKE_INSTALL_PREFIX:PATH=$1"
       ;;
+    --enable-debug)
+      cmd="${cmd} -DCMAKE_BUILD_TYPE=Debug"
+      ;;
     --help)
       usage
       exit

-----------------------------------------------------------------------

Summary of changes:
 configure              |  7 +++++--
 util/geosop/GeosOp.cpp | 14 +++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list