about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--README2
-rw-r--r--man/mintro.72
-rw-r--r--man/mseq.14
-rw-r--r--mscan.c6
-rw-r--r--mseq.c13
-rw-r--r--seq.c4
6 files changed, 16 insertions, 15 deletions
diff --git a/README b/README
index a902870..e454722 100644
--- a/README
+++ b/README
@@ -82,7 +82,7 @@ EXAMPLES
 CONCEPTS
      Santoku deals with messages (which are files), folders (which are Maildir
      folders), sequences (which are newline-separated lists of messages,
-     possibly persisted on disk in ~/.santoku/map), and the current message
+     possibly persisted on disk in ~/.santoku/seq), and the current message
      (kept as a symlink in ~/.santoku/cur).
 
      Messages in the persisted sequence can be referred to using special
diff --git a/man/mintro.7 b/man/mintro.7
index 4472b55..622cf20 100644
--- a/man/mintro.7
+++ b/man/mintro.7
@@ -134,7 +134,7 @@ As usual with pipes, the sky is the limit.
 deals with messages (which are files),
 folders (which are Maildir folders),
 sequences (which are newline-separated lists of messages, possibly persisted on disk in
-.Pa ~/.santoku/map ) ,
+.Pa ~/.santoku/seq ) ,
 and the current message (kept as a symlink in
 .Pa ~/.santoku/cur ) .
 .Pp
diff --git a/man/mseq.1 b/man/mseq.1
index 465f950..232ceee 100644
--- a/man/mseq.1
+++ b/man/mseq.1
@@ -58,10 +58,10 @@ but append to the mail sequence instead of replacing it.
 .El
 .Sh ENVIRONMENT
 .Bl -tag -width Ds
-.It Ev MAILMAP
+.It Ev MAILSEQ
 File were the sequence is stored.
 (Default:
-.Pa ~/.santoku/map )
+.Pa ~/.santoku/seq )
 .El
 .Sh EXIT STATUS
 .Ex -std
diff --git a/mscan.c b/mscan.c
index 94afb2c..4cc59b6 100644
--- a/mscan.c
+++ b/mscan.c
@@ -69,10 +69,10 @@ oneline(char *file)
 {
 	static int init;
 	if (!init) {
-		// delay loading of the seqmap until we need to scan the first
+		// delay loading of the seq until we need to scan the first
 		// file, in case someone in the pipe updated the map before
-		char *seqmap = blaze822_seq_open(0);
-		blaze822_seq_load(seqmap);
+		char *seq = blaze822_seq_open(0);
+		blaze822_seq_load(seq);
 		cur = blaze822_seq_cur();
 		init = 1;
 	}
diff --git a/mseq.c b/mseq.c
index 7ce843f..f20ec5a 100644
--- a/mseq.c
+++ b/mseq.c
@@ -1,4 +1,5 @@
 #include <dirent.h>
+#include <errno.h>
 #include <limits.h>
 #include <search.h>
 #include <string.h>
@@ -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 {
diff --git a/seq.c b/seq.c
index 56caa56..3d5b70e 100644
--- a/seq.c
+++ b/seq.c
@@ -40,9 +40,9 @@ blaze822_seq_open(char *file)
 
 	// env $SEQ or something
 	if (!file)
-		file = getenv("MAILMAP");
+		file = getenv("MAILSEQ");
 	if (!file)
-		file = blaze822_home_file(".santoku/map");
+		file = blaze822_home_file(".santoku/seq");
 	fd = open(file, O_RDONLY);
 	if (!fd)
 		return 0;