summaryrefslogtreecommitdiff
path: root/db/test/scr005
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-08-14 16:42:12 +0000
committerjbj <devnull@localhost>2002-08-14 16:42:12 +0000
commit4aac97a69fb764add274089dbc7a1c5bd02c59c8 (patch)
tree0b605d8c05d5a439ebb193efe87e19e24e60b7c1 /db/test/scr005
parentd481ba55c02407124c499c7800ea556786137bc5 (diff)
downloadrpm-4aac97a69fb764add274089dbc7a1c5bd02c59c8.tar.gz
rpm-4aac97a69fb764add274089dbc7a1c5bd02c59c8.tar.bz2
rpm-4aac97a69fb764add274089dbc7a1c5bd02c59c8.zip
db-4.1.17 orphans.
CVS patchset: 5631 CVS date: 2002/08/14 16:42:12
Diffstat (limited to 'db/test/scr005')
-rw-r--r--db/test/scr005/chk.nl26
1 files changed, 19 insertions, 7 deletions
diff --git a/db/test/scr005/chk.nl b/db/test/scr005/chk.nl
index 876be2f94..4ad1b3c7c 100644
--- a/db/test/scr005/chk.nl
+++ b/db/test/scr005/chk.nl
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# Id: chk.nl,v 1.5 2001/10/12 17:55:33 bostic Exp
+# Id: chk.nl,v 1.6 2002/01/07 15:12:12 bostic Exp
#
# Check to make sure that there are no trailing newlines in __db_err calls.
@@ -68,12 +68,23 @@ chk(fp, name)
if (ch == '\n')
++line;
}
- while ((ch = getc(fp)) != '"') {
- if (ch == EOF)
+ while ((ch = getc(fp)) != '"')
+ switch (ch) {
+ case EOF:
return (exitv);
- if (ch == '\n')
+ case '\\n':
++line;
- if (ch == '\\\\')
+ break;
+ case '.':
+ if ((ch = getc(fp)) != '"')
+ ungetc(ch, fp);
+ else {
+ fprintf(stderr,
+ "%s: <period> at line %d\n", name, line);
+ exitv = 1;
+ }
+ break;
+ case '\\\\':
if ((ch = getc(fp)) != 'n')
ungetc(ch, fp);
else if ((ch = getc(fp)) != '"')
@@ -83,7 +94,8 @@ chk(fp, name)
"%s: <newline> at line %d\n", name, line);
exitv = 1;
}
- }
+ break;
+ }
}
return (exitv);
}
@@ -93,7 +105,7 @@ cc t.c -o t
if ./t $d/*/*.[ch] $d/*/*.cpp $d/*/*.in ; then
:
else
- echo "FAIL: found __db_err calls with newline strings."
+ echo "FAIL: found __db_err calls ending with periods/newlines."
exit 1
fi