diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-01-05 05:11:26 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-01-05 05:11:26 +0000 |
commit | db02ba48a91c9f900353d0e76beb011b8cb70c4b (patch) | |
tree | ebc9b2c64dfe5484d208a6e807a675ba29cec4d9 | |
parent | 09bb6a3a19882da1b63c609887ba7a712937913d (diff) | |
parent | 4262890247be3aa9917a2d3f4edaa1fc9129e070 (diff) | |
download | one-true-awk-android14-d1-s6-release.tar.gz |
Snap for 9456165 from 4262890247be3aa9917a2d3f4edaa1fc9129e070 to udc-d1-releaseandroid-14.0.0_r9android-14.0.0_r8android-14.0.0_r7android-14.0.0_r6android-14.0.0_r5android-14.0.0_r4android-14.0.0_r3android-14.0.0_r12android-14.0.0_r11android-14.0.0_r10android14-d1-s7-releaseandroid14-d1-s6-releaseandroid14-d1-s5-releaseandroid14-d1-s4-releaseandroid14-d1-s3-releaseandroid14-d1-s2-releaseandroid14-d1-s1-releaseandroid14-d1-release
Change-Id: Ie887ff6317eed3fcb683194e7b7e7b28b340775d
-rw-r--r-- | FIXES | 6 | ||||
-rw-r--r-- | METADATA | 10 | ||||
-rw-r--r-- | lex.c | 31 | ||||
-rw-r--r-- | main.c | 2 |
4 files changed, 34 insertions, 15 deletions
@@ -25,6 +25,12 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August 1987. +Dec 15, 2022: + Force hex escapes in strings to be no more than two characters, + as they already are in regular expressions. This brings internal + consistency, as well as consistency with gawk. Thanks to + Arnold Robbins. + Sep 12, 2022: adjbuf minlen error (cannot be 0) in cat, resulting in NULL pbuf. discovered by todd miller. also use-after-free issue with @@ -1,3 +1,7 @@ +# This project was upgraded with external_updater. +# Usage: tools/external_updater/updater.sh update one-true-awk +# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md + name: "one-true-awk" description: "This is the version of awk described in \'The AWK Programming Language\', by Al Aho, Brian Kernighan, and Peter Weinberger (Addison-Wesley, 1988, ISBN 0-201-07981-X)." third_party { @@ -5,11 +9,11 @@ third_party { type: GIT value: "https://github.com/onetrueawk/awk.git" } - version: "9e248c317b88470fc86aa7c988919dc49452c88c" + version: "5e49ea4d1f71d9134734011f2151cae4dbec5e5f" license_type: NOTICE last_upgrade_date { year: 2022 - month: 9 - day: 12 + month: 12 + day: 16 } } @@ -416,19 +416,28 @@ int string(void) break; case 'x': /* hex \x0-9a-fA-F + */ - { char xbuf[100], *px; - for (px = xbuf; (c = input()) != 0 && px-xbuf < 100-2; ) { - if (isdigit(c) - || (c >= 'a' && c <= 'f') - || (c >= 'A' && c <= 'F')) - *px++ = c; - else + { + int i; + + n = 0; + for (i = 1; i <= 2; i++) { + c = input(); + if (c == 0) + break; + if (isxdigit(c)) { + c = tolower(c); + n *= 16; + if (isdigit(c)) + n += (c - '0'); + else + n += 10 + (c - 'a'); + } else break; } - *px = 0; - unput(c); - sscanf(xbuf, "%x", (unsigned int *) &n); - *bp++ = n; + if (n) + *bp++ = n; + else + unput(c); break; } @@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20220912"; +const char *version = "version 20221215"; #define DEBUG #include <stdio.h> |