[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #64240] [troff] make numeric expression parser more sensitive to no
From: |
G. Branden Robinson |
Subject: |
[bug #64240] [troff] make numeric expression parser more sensitive to nonsense |
Date: |
Sat, 17 Aug 2024 11:44:36 -0400 (EDT) |
Update of bug #64240 (group groff):
Status: None => In Progress
Assigned to: None => gbranden
_______________________________________________________
Follow-up Comment #4:
I must know the formatter better now. This was easy.
diff --git a/src/roff/troff/reg.cpp b/src/roff/troff/reg.cpp
index 7daf30912..57f10b5a7 100644
--- a/src/roff/troff/reg.cpp
+++ b/src/roff/troff/reg.cpp
@@ -323,8 +323,14 @@ void define_register()
register_dictionary.define(nm, r);
}
r->set_value(v);
- if (tok.is_space() && has_arg() && read_measurement(&v, 'u'))
- r->set_increment(v);
+ if (tok.is_space()) {
+ if (has_arg() && read_measurement(&v, 'u'))
+ r->set_increment(v);
+ }
+ else if (has_arg() && !tok.is_tab())
+ warning(WARN_SYNTAX, "expected end of line or an auto-increment"
+ " argument in register definition request; got %1",
+ tok.description());
}
skip_line();
}
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64240>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature