There was a segfault when sent was called without arguments. Now we use stdin
when there's no argument or - is used. Thanks to izabera for the report.
Usage
- sent FILE
+ sent [FILE]
-If FILE equals `-`, stdin will be read. Produce image slides by prepending a
-`@` in front of the filename as a single paragraph. Lines starting with `#` will
-be ignored. A `\` at the beginning of the line escapes `@` and `#`. A
-presentation file could look like this:
+If FILE is omitted or equals `-`, stdin will be read. Produce image slides by
+prepending a `@` in front of the filename as a single paragraph. Lines starting
+with `#` will be ignored. A `\` at the beginning of the line escapes `@` and
+`#`. A presentation file could look like this:
sent
usage()
{
die("sent " VERSION " (c) 2014-2015 markus.teich@stusta.mhn.de\n" \
- "usage: sent FILE", argv0);
+ "usage: sent [FILE]", argv0);
}
int
usage();
} ARGEND;
- if ((fp = strcmp(argv[0], "-") ? fopen(argv[0], "r") : stdin)) {
- load(fp);
- fclose(fp);
- } else {
+ if (!argv[0] || !strcmp(argv[0], "-"))
+ fp = stdin;
+ else if (!(fp = fopen(argv[0], "r")))
die("Unable to open '%s' for reading:", argv[0]);
- }
+
+ load(fp);
+ fclose(fp);
if (!slidecount)
usage();