aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2021-02-10 03:41:53 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-02-10 03:41:53 +0000
commit39d1e116127e21f74e3a34777dc931e706dc40bf (patch)
treeeae92c9bba3cce66e0f9bff3e57ff3a0c6472d50
parent2b34dbd4fc9a0ff73557d2a3c34de0d09fc3185b (diff)
parent7121bc054859f03d51c7912cab5b04c5b72366c6 (diff)
downloadone-true-awk-39d1e116127e21f74e3a34777dc931e706dc40bf.tar.gz
Upgrade one-true-awk to 178f660b5a4fde6f39e8065185373166f55b6e0c am: b0528ac077 am: 7121bc0548
Original change: https://android-review.googlesource.com/c/platform/external/one-true-awk/+/1582270 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I699ec4293f126d671eba3d64b7ec1d59b7287c26
-rw-r--r--FIXES4
-rw-r--r--METADATA6
-rw-r--r--lib.c9
-rw-r--r--main.c2
-rwxr-xr-xtestdir/T.errmsg4
5 files changed, 18 insertions, 7 deletions
diff --git a/FIXES b/FIXES
index 20b4bd8..82c8f8f 100644
--- a/FIXES
+++ b/FIXES
@@ -25,6 +25,10 @@ THIS SOFTWARE.
This file lists all bug fixes, changes, etc., made since the AWK book
was sent to the printers in August, 1987.
+January 06, 2021:
+ Fix a decision bug with trailing stuff in lib.c:is_valid_number
+ after recent changes. Thanks to Ozan Yigit.
+
December 18, 2020:
Fix problems converting inf and NaN values in lib.c:is_valid_number.
Enhance number to string conversion to do the right thing for
diff --git a/METADATA b/METADATA
index 833688d..8f9155d 100644
--- a/METADATA
+++ b/METADATA
@@ -5,11 +5,11 @@ third_party {
type: GIT
value: "https://github.com/onetrueawk/awk.git"
}
- version: "7d1848cfa6b7b3bb9a7c851339626982198a57bc"
+ version: "178f660b5a4fde6f39e8065185373166f55b6e0c"
license_type: NOTICE
last_upgrade_date {
year: 2021
- month: 1
- day: 5
+ month: 2
+ day: 9
}
}
diff --git a/lib.c b/lib.c
index e8310a9..18adbd2 100644
--- a/lib.c
+++ b/lib.c
@@ -822,10 +822,17 @@ convert:
if (result != NULL)
*result = r;
- retval = (isspace(*ep) || *ep == '\0' || trailing_stuff_ok);
+ /*
+ * check for trailing stuff
+ */
+ while (isspace(*ep))
+ ep++;
if (no_trailing != NULL)
*no_trailing = (*ep == '\0');
+ // return true if found the end, or trailing stuff is allowed
+ retval = *ep == '\0' || trailing_stuff_ok;
+
return retval;
}
diff --git a/main.c b/main.c
index 5970cb4..2b1d64c 100644
--- a/main.c
+++ b/main.c
@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20201218";
+const char *version = "version 20210106";
#define DEBUG
#include <stdio.h>
diff --git a/testdir/T.errmsg b/testdir/T.errmsg
index bf2fd6a..ee2450a 100755
--- a/testdir/T.errmsg
+++ b/testdir/T.errmsg
@@ -155,8 +155,8 @@ BEGIN { next }
illegal .*next.* from END
END { next; print NR }
-can.t open file /etc/passwd
-BEGIN { print "abc" >"/etc/passwd" }
+can.t open file ./nonexistentdir/foo
+BEGIN { print "abc" >"./nonexistentdir/foo" }
you can.t define function f more than once
function f() { print 1 }