tag, to strip trailing whitespace (per current locale, not just ASCII space
characters), and prohibit any internal space characters in tag names.
(This is not the patch supplied in the bug report; that patch changed the tag
handling to allow spaces in tag names, which we haven't previously allowed. On
the other hand, we haven't specifically disallowed internal tabs or other
whitespace, either, and this patch does so.)
ticket: 2614
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16697
dc483132-0cff-0310-8789-
dd5450dbe970
2004-08-27 Ken Raeburn <raeburn@mit.edu>
+ * prof_parse.c (parse_std_line): Rewrite handling of whitespace in
+ and after tag, to strip trailing whitespace (per current locale,
+ not just ASCII space characters), and prohibit any internal space
+ characters in tag names.
+
* profile.swg: New file.
* configure.in: Look for Tcl.
* Makefile.in (profile_tcl, profile_tcl.c, profile_tcl.o): New
cp = strchr(cp, '=');
if (!cp)
return PROF_RELATION_SYNTAX;
+ if (cp == tag)
+ return PROF_RELATION_SYNTAX;
*cp = '\0';
- p = strchr(tag, ' ');
- if (p) {
- *p = '\0';
- p = skip_over_blanks(p+1);
- if (p != cp)
- return PROF_RELATION_SYNTAX;
+ p = tag;
+ /* Look for whitespace on left-hand side. */
+ while (p < cp && !isspace((int)*p))
+ p++;
+ if (p < cp) {
+ /* Found some sort of whitespace. */
+ *p++ = 0;
+ /* If we have more non-whitespace, it's an error. */
+ while (p < cp) {
+ if (!isspace((int)*p))
+ return PROF_RELATION_SYNTAX;
+ p++;
+ }
}
cp = skip_over_blanks(cp+1);
value = cp;