summaryrefslogtreecommitdiffstats
path: root/src
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
parent37573cd7a4478474a1c1acb98beeac665c73885c (diff)
downloadkrb5-01f49f47431347b02b4dd153b0b11f19d6ab6f1d.tar.gz
krb5-01f49f47431347b02b4dd153b0b11f19d6ab6f1d.tar.xz
krb5-01f49f47431347b02b4dd153b0b11f19d6ab6f1d.zip
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')
-rw-r--r--src/util/profile/ChangeLog5
-rw-r--r--src/util/profile/prof_parse.c28
-rw-r--r--src/util/profile/test_parse.c4
3 files changed, 21 insertions, 16 deletions
diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog
index 2f8620dbc..209dace7e 100644
--- a/src/util/profile/ChangeLog
+++ b/src/util/profile/ChangeLog
@@ -1,3 +1,8 @@
+Wed Feb 14 16:43:48 1996 <tytso@rsts-11.mit.edu>
+
+ * prof_parse.c (parse_std_line): Make parsing more flexible, so we
+ don't barf over lack of spaces around the equals sign.
+
Tue Dec 12 19:18:14 1995 Mark Eichin <eichin@cygnus.com>
* krb5.conf: use host:portnum in example files, not host,portnum.
diff --git a/src/util/profile/prof_parse.c b/src/util/profile/prof_parse.c
index 121b51ddf..eed309df0 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);
}
diff --git a/src/util/profile/test_parse.c b/src/util/profile/test_parse.c
index 0e92fdaeb..346615401 100644
--- a/src/util/profile/test_parse.c
+++ b/src/util/profile/test_parse.c
@@ -51,6 +51,10 @@ int main(argc, argv)
printf("\n\nDebugging dump.\n");
dump_profile(root, 0);
+#if 1
profile_free_node(root);
+#else
+ dump_profile_to_file(root, 0, stdout);
+#endif
return 0;
}