summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2017-04-09 18:53:50 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2017-04-09 18:53:50 -0400
commit215618921d2515040bd02fecc1a3438cd4949a5b (patch)
treea749a07aaddc36b8523a01a272d5311cb0535b39
parent0d3bc6ff432fe62a6e46c543311d86c2781915c2 (diff)
downloadgawk-215618921d2515040bd02fecc1a3438cd4949a5b.tar.gz
Fix comment in fw_parse_field and white space in gawkapi.h.
-rw-r--r--ChangeLog5
-rw-r--r--field.c8
-rw-r--r--gawkapi.h2
3 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index d740b43a..60f3a734 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * field.c (fw_parse_field): Edit comment about resetting shift state.
+ * gawkapi.h (awk_fieldwidth_info_t): Make white space more uniform.
+
2017-03-27 Arnold D. Robbins <arnold@skeeve.com>
* field.c (parse_field_func_t): New typedef. Used as needed.
diff --git a/field.c b/field.c
index b5f28c17..38105745 100644
--- a/field.c
+++ b/field.c
@@ -771,10 +771,10 @@ fw_parse_field(long up_to, /* parse only up to this field number */
return nf;
if (gawk_mb_cur_max > 1 && fw->use_chars) {
/*
- * Reset the shift state for each field, since there might
- * be who-knows-what kind of stuff in between fields,
- * and we assume each field starts with a valid (possibly
- * multibyte) character.
+ * Reset the shift state. Arguably, the shift state should
+ * be part of the file state and carried forward at all times,
+ * but nobody has complained so far, so this may not matter
+ * in practice.
*/
memset(&mbs, 0, sizeof(mbstate_t));
while (nf < up_to) {
diff --git a/gawkapi.h b/gawkapi.h
index a8d6279f..484ab27e 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -132,7 +132,7 @@ typedef struct {
size_t nf;
struct awk_field_info {
size_t skip; /* amount to skip before field starts */
- size_t len; /* length of field */
+ size_t len; /* length of field */
} fields[1]; /* actual dimension should be nf */
} awk_fieldwidth_info_t;