projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
743b739
)
Use portable fgets instead of getline.
author
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 5 Jul 2007 18:37:43 +0000
(18:37 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 5 Jul 2007 18:37:43 +0000
(18:37 +0000)
src/icu_chain_test.c
patch
|
blob
|
history
diff --git
a/src/icu_chain_test.c
b/src/icu_chain_test.c
index
6c630ae
..
aed6af2
100644
(file)
--- a/
src/icu_chain_test.c
+++ b/
src/icu_chain_test.c
@@
-415,9
+415,8
@@
static void print_info(const struct config_t *p_config)
static void process_text_file(const struct config_t *p_config)
{
static void process_text_file(const struct config_t *p_config)
{
- char * line = 0;
- size_t line_cap = 0;
- ssize_t line_len;
+ char *line = 0;
+ char linebuf[1024];
xmlDoc *doc = xmlParseFile(config.conffile);
xmlNode *xml_node = xmlDocGetRootElement(doc);
xmlDoc *doc = xmlParseFile(config.conffile);
xmlNode *xml_node = xmlDocGetRootElement(doc);
@@
-441,7
+440,8
@@
static void process_text_file(const struct config_t *p_config)
"<tokens>\n");
// read input lines for processing
"<tokens>\n");
// read input lines for processing
- while ((line_len = getline(&line, &line_cap, config.infile)) != -1) {
+ while ((line=fgets(linebuf, sizeof(linebuf)-1, config.infile)))
+ {
success = icu_chain_assign_cstr(config.chain, line, &status);
line_count++;
success = icu_chain_assign_cstr(config.chain, line, &status);
line_count++;