[hackers] [sent] no need to reimplement cat here || Markus Teich

From: <git_AT_suckless.org>
Date: Sat, 6 Feb 2016 14:10:26 +0100 (CET)

commit 616aafdcb9bd336a870d875a20645d8002d8a028
Author: Markus Teich <markus.teich_AT_stusta.mhn.de>
AuthorDate: Sat Feb 6 14:12:47 2016 +0100
Commit: Markus Teich <markus.teich_AT_stusta.mhn.de>
CommitDate: Sat Feb 6 14:12:47 2016 +0100

    no need to reimplement cat here

diff --git a/README.md b/README.md
index e016874..70f60f9 100644
--- a/README.md
+++ b/README.md
_AT_@ -25,9 +25,9 @@ You can navigate with the arrow keys and quit with `q`.
 
 Usage
 
- sent FILE1 [FILE2 ...]
+ sent FILE
 
-If one FILE equals `-`, stdin will be read. Produce image slides by prepending a
+If FILE equals `-`, stdin will be read. Produce image slides by prepending a
 `_AT_` in front of the filename as a single paragraph. Lines starting with `#` will
 be ignored. A `\` at the beginning of the line escapes `_AT_` and `#`. A
 presentation file could look like this:
diff --git a/sent.c b/sent.c
index a098d3a..6f5c139 100644
--- a/sent.c
+++ b/sent.c
_AT_@ -689,13 +689,12 @@ void
 usage()
 {
         die("sent " VERSION " (c) 2014-2015 markus.teich_AT_stusta.mhn.de\n" \
- "usage: sent FILE1 [FILE2 ...]", argv0);
+ "usage: sent FILE", argv0);
 }
 
 int
 main(int argc, char *argv[])
 {
- int i;
         FILE *fp = NULL;
 
         ARGBEGIN {
_AT_@ -704,13 +703,11 @@ main(int argc, char *argv[])
                 usage();
         } ARGEND;
 
- for (i = 0; i < argc; i++) {
- if ((fp = strcmp(argv[i], "-") ? fopen(argv[i], "r") : stdin)) {
- load(fp);
- fclose(fp);
- } else {
- die("Unable to open '%s' for reading:", argv[i]);
- }
+ if ((fp = strcmp(argv[0], "-") ? fopen(argv[0], "r") : stdin)) {
+ load(fp);
+ fclose(fp);
+ } else {
+ die("Unable to open '%s' for reading:", argv[0]);
         }
 
         if (!slidecount)
Received on Sat Feb 06 2016 - 14:10:26 CET

This archive was generated by hypermail 2.3.0 : Sat Feb 06 2016 - 14:12:16 CET