aboutsummaryrefslogtreecommitdiff
path: root/src/util/profile/prof_parse.c
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1996-02-14 21:48:05 +0000
committerTheodore Tso <tytso@mit.edu>1996-02-14 21:48:05 +0000
commit01f49f47431347b02b4dd153b0b11f19d6ab6f1d (patch)
tree74b4f8e7b3d68118b79fc5781f21bb3e5f324be2 /src/util/profile/prof_parse.c
parent37573cd7a4478474a1c1acb98beeac665c73885c (diff)
downloadkrb5-01f49f47431347b02b4dd153b0b11f19d6ab6f1d.zip
krb5-01f49f47431347b02b4dd153b0b11f19d6ab6f1d.tar.gz
krb5-01f49f47431347b02b4dd153b0b11f19d6ab6f1d.tar.bz2
Make parsing more flexible, so we don't barf over lack of spaces
around the equals sign. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7479 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/profile/prof_parse.c')
-rw-r--r--src/util/profile/prof_parse.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/util/profile/prof_parse.c b/src/util/profile/prof_parse.c
index 121b51d..eed309d 100644
--- a/src/util/profile/prof_parse.c
+++ b/src/util/profile/prof_parse.c
@@ -110,14 +110,18 @@ static errcode_t parse_std_line(line, state)
/*
* Parse the relations
*/
- p = strchr(cp, ' ');
- if (!p)
- return PROF_RELATION_SYNTAX;
- *p = '\0';
tag = cp;
- cp = skip_over_blanks(p+1);
- if (*cp != '=')
+ cp = strchr(cp, '=');
+ if (!cp)
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;
+ }
cp = skip_over_blanks(cp+1);
value = cp;
if (value[0] == 0) {
@@ -260,16 +264,13 @@ void dump_profile_to_file(root, level, dstfile)
&name, &p);
if (retval)
break;
- if (level == 0) /* [xxx] */
- {
+ if (level == 0) { /* [xxx] */
for (i=0; i < level; i++)
fprintf(dstfile, "\t");
fprintf(dstfile, "[%s]\r", name);
dump_profile_to_file(p, level+1, dstfile);
fprintf(dstfile, "\r");
- }
- else if (level == 1) /* xxx = { ... } */
- {
+ } else { /* xxx = { ... } */
for (i=0; i < level; i++)
fprintf(dstfile, "\t");
fprintf(dstfile, "%s = {\r", name);
@@ -278,10 +279,5 @@ void dump_profile_to_file(root, level, dstfile)
fprintf(dstfile, "\t");
fprintf(dstfile, "}\r");
}
- else /* +xxx+ */
- {
- /* don't know what comes next, this should get someones attention */
- fprintf(dstfile, "+%s+");
- }
} while (iter != 0);
}