summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2006-03-19 12:28:16 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2006-03-19 12:28:16 +0100
commit2eab16a3103a1ba8804d937f1087d2e3f8ab7886 (patch)
treeb4ac2e226d8ad32769e6fd8df1838360447c4fbd /tools.c
parent94afe13373a1afe595075f31ad8ade9dcf125b20 (diff)
downloadvdr-2eab16a3103a1ba8804d937f1087d2e3f8ab7886.tar.gz
vdr-2eab16a3103a1ba8804d937f1087d2e3f8ab7886.tar.bz2
Fixed cReadLine::Read() for lines that end with the infamous "\r\n"
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools.c b/tools.c
index fb887893..18f95376 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.114 2006/02/05 11:05:56 kls Exp $
+ * $Id: tools.c 1.115 2006/03/19 12:28:16 kls Exp $
*/
#include "tools.h"
@@ -829,8 +829,14 @@ char *cReadLine::Read(FILE *f)
int n = getline(&buffer, &size, f);
if (n > 0) {
n--;
- if (buffer[n] == '\n')
+ if (buffer[n] == '\n') {
buffer[n] = 0;
+ if (n > 0) {
+ n--;
+ if (buffer[n] == '\r')
+ buffer[n] = 0;
+ }
+ }
return buffer;
}
return NULL;