aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorChong Yidong2009-07-08 03:20:03 +0000
committerChong Yidong2009-07-08 03:20:03 +0000
commit678bc1f5248f0cf513e2306555564881355a6825 (patch)
tree9926999da275f2816d65a08f12d9ccc83ebe67e6 /lib-src
parent88d036078bba84460897932ed8686e30f6aa0d21 (diff)
downloademacs-678bc1f5248f0cf513e2306555564881355a6825.tar.gz
emacs-678bc1f5248f0cf513e2306555564881355a6825.zip
* b2m.c (main): Ensure that each message ends in two newlines.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog4
-rw-r--r--lib-src/b2m.c17
2 files changed, 18 insertions, 3 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index aa01d98aac2..199d94d5acc 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,7 @@
12009-07-08 E. Jay Berkenbilt <ejb@ql.org> (tiny change)
2
3 * b2m.c (main): Ensure that each message ends in two newlines.
4
12009-07-03 Jason Rumney <jasonr@gnu.org> 52009-07-03 Jason Rumney <jasonr@gnu.org>
2 6
3 * emacsclient.c (w32_set_user_model_id): Use standard types. 7 * emacsclient.c (w32_set_user_model_id): Use standard types.
diff --git a/lib-src/b2m.c b/lib-src/b2m.c
index a3ab9a5bb9a..7de48e6a522 100644
--- a/lib-src/b2m.c
+++ b/lib-src/b2m.c
@@ -94,7 +94,7 @@ main (argc, argv)
94 int argc; 94 int argc;
95 char **argv; 95 char **argv;
96{ 96{
97 logical labels_saved, printing, header; 97 logical labels_saved, printing, header, first, last_was_blank_line;
98 time_t ltoday; 98 time_t ltoday;
99 struct tm *tm; 99 struct tm *tm;
100 char *labels, *p, *today; 100 char *labels, *p, *today;
@@ -139,7 +139,8 @@ main (argc, argv)
139 exit (EXIT_SUCCESS); 139 exit (EXIT_SUCCESS);
140 } 140 }
141 141
142 labels_saved = printing = header = FALSE; 142 labels_saved = printing = header = last_was_blank_line = FALSE;
143 first = TRUE;
143 ltoday = time (0); 144 ltoday = time (0);
144 /* Convert to a string, checking for out-of-range time stamps. 145 /* Convert to a string, checking for out-of-range time stamps.
145 Don't use 'ctime', as that might dump core if the hardware clock 146 Don't use 'ctime', as that might dump core if the hardware clock
@@ -170,6 +171,10 @@ main (argc, argv)
170 continue; 171 continue;
171 else if (data.buffer[1] == '\f') 172 else if (data.buffer[1] == '\f')
172 { 173 {
174 if (first)
175 first = FALSE;
176 else if (! last_was_blank_line)
177 puts("");
173 /* Save labels. */ 178 /* Save labels. */
174 readline (&data, stdin); 179 readline (&data, stdin);
175 p = strtok (data.buffer, " ,\r\n\t"); 180 p = strtok (data.buffer, " ,\r\n\t");
@@ -195,7 +200,13 @@ main (argc, argv)
195 } 200 }
196 201
197 if (printing) 202 if (printing)
198 puts (data.buffer); 203 {
204 puts (data.buffer);
205 if (data.buffer[0] == '\0')
206 last_was_blank_line = TRUE;
207 else
208 last_was_blank_line = FALSE;
209 }
199 } 210 }
200 211
201 return EXIT_SUCCESS; 212 return EXIT_SUCCESS;