[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [help-recutils] extra newline created when using recsel and recfmt?
From: |
Jose E. Marchesi |
Subject: |
Re: [help-recutils] extra newline created when using recsel and recfmt? |
Date: |
Tue, 24 Sep 2013 00:08:08 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Hi.
when I use the following command:
> recsel -e "Blah = '"blah"'" tmp.rec | recfmt -f tmp.tmpl
on tmp.rec:
> %rec: one
>
> Blah: blah
and tmp.tmpl:
> Line one
>
> And the last line
I get an output file with 4 lines instead of 3:
Yes, this is a bug. I just pushed a patch fixing this. Thank you for
reporting :)
As a workaround you can apply the following patch to the 1.5 source
code.
diff --git a/utils/recfmt.c b/utils/recfmt.c
index b25110c..0a03416 100644
--- a/utils/recfmt.c
+++ b/utils/recfmt.c
@@ -7,7 +7,7 @@
*
*/
-/* Copyright (C) 2010, 2011, 2012 Jose E. Marchesi */
+/* Copyright (C) 2010-2013 Jose E. Marchesi */
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -273,7 +273,7 @@ recfmt_process_db (rec_db_t db, char *template)
result = recfmt_apply_template (record, template);
if (result && (*result != '\0'))
{
- puts (result);
+ printf ("%s", result);
free (result);
}
}