summaryrefslogtreecommitdiff
path: root/apps/jstest_main.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-06-29 20:51:24 +0100
committerRobin Watts <robin.watts@artifex.com>2012-06-29 20:51:24 +0100
commit495e6eebd18a5f341bede2871744eef445bf1985 (patch)
treed0b6b2f1a4bf1b48e2fce892697e7b8c4740baca /apps/jstest_main.c
parent570f0cb8c4f467279ff1f6141ef052b4617fe68b (diff)
downloadmupdf-495e6eebd18a5f341bede2871744eef445bf1985.tar.xz
Fix mujstest never screenshotting under unix.
A problem in the match routine (that didn't show up under windows due to line endings) meant that screenshots had no effect.
Diffstat (limited to 'apps/jstest_main.c')
-rw-r--r--apps/jstest_main.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/jstest_main.c b/apps/jstest_main.c
index 98e55909..124ca24f 100644
--- a/apps/jstest_main.c
+++ b/apps/jstest_main.c
@@ -150,6 +150,7 @@ my_getline(FILE *file)
if (c < 0)
return NULL;
+ /* Read the line in */
do
{
*d++ = (char)c;
@@ -157,6 +158,7 @@ my_getline(FILE *file)
}
while (c >= 32 && space--);
+ /* If we ran out of space, skip the rest of the line */
if (space == 0)
{
while (c >= 32)
@@ -181,6 +183,11 @@ match(char **line, const char *match)
while (*s == *match)
{
+ if (*s == 0)
+ {
+ *line = s;
+ return 1;
+ }
s++;
match++;
}
@@ -284,7 +291,7 @@ main(int argc, char *argv[])
if (line == NULL)
continue;
if (verbosity)
- fprintf(stderr, "%s\n", line);
+ fprintf(stderr, "'%s'\n", line);
if (match(&line, "%"))
{
/* Comment */
@@ -347,6 +354,10 @@ main(int argc, char *argv[])
{
unescape_string(td_textinput, line);
}
+ else
+ {
+ fprintf(stderr, "Unmatched: %s\n", line);
+ }
}
while (!feof(script));