Introduction
Introduction Statistics Contact Development Disclaimer Help
Fix regression from 3d2081c, correctly handle '\n' ending lines (bis) - sacc - …
git clone git://git.codemadness.org/sacc
Log
Files
Refs
LICENSE
---
commit 1f25175ac21819a702f38edaf034a16825cd5c07
parent 3399f31a720905a2ebd03191945307b9aafb0ad4
Author: Quentin Rameau <[email protected]>
Date: Fri, 24 Aug 2018 18:21:44 +0200
Fix regression from 3d2081c, correctly handle '\n' ending lines (bis)
This is a followup to 43803be, the patch was not finished.
Diffstat:
M sacc.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/sacc.c b/sacc.c
@@ -298,13 +298,16 @@ displaytextitem(Item *item)
static char *
pickfield(char **raw, const char *sep)
{
- char *c, *f = *raw;
+ char c, *r, *f = *raw;
- for (c = *raw; *c && !strchr(sep, *c); ++c)
- ;
+ for (r = *raw; (c = *r) && !strchr(sep, c); ++r) {
+ if (c == '\n')
+ goto skipsep;
+ }
- *c = '\0';
- *raw = c+1;
+ *r++ = '\0';
+skipsep:
+ *raw = r;
return f;
}
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.