From 2b81707c51f2ae26db5129d15741fe89a3b781d2 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Tue, 26 Jul 2016 16:55:55 +0200 Subject: rename map to seq The old terminology didn't make much sense to users. --- mseq.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'mseq.c') diff --git a/mseq.c b/mseq.c index 7ce843f..f20ec5a 100644 --- a/mseq.c +++ b/mseq.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -181,9 +182,9 @@ stdinmode() if (Sflag) { // XXX locking? - seqfile = getenv("MAILMAP"); + seqfile = getenv("MAILSEQ"); if (!seqfile) - seqfile = blaze822_home_file(".santoku/map"); + seqfile = blaze822_home_file(".santoku/seq"); snprintf(tmpfile, sizeof tmpfile, "%s-", seqfile); snprintf(oldfile, sizeof oldfile, "%s.old", seqfile); outfile = fopen(tmpfile, "w+"); @@ -223,7 +224,7 @@ stdinmode() if (Sflag) { fflush(outfile); - if (rename(seqfile, oldfile) < 0) { + if (rename(seqfile, oldfile) < 0 && errno != ENOENT) { perror("rename"); exit(2); } @@ -270,8 +271,8 @@ main(int argc, char *argv[]) if (optind == argc && !isatty(0)) return stdinmode(); - char *map = blaze822_seq_open(0); - if (!map) + char *seq = blaze822_seq_open(0); + if (!seq) return 1; int i; @@ -291,7 +292,7 @@ hack: printf("%s\n", a); continue; } - while ((f = blaze822_seq_next(map, a, &iter))) { + while ((f = blaze822_seq_next(seq, a, &iter))) { if (nflag) { printf("%ld\n", iter.line-1); } else { -- cgit 1.4.1