Ticket #17 (closed defect: released)
Function file_to_string() throws away result
| Reported by: | C.vanReeuwijk | Owned by: | olly |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Omega | Version: | other |
| Severity: | major | Keywords: | |
| Cc: | Blocked By: | ||
| Operating System: | other | Blocking: |
Description
It took me some time to convince myself this really is a bug, since it essentially disables all indexing of plain text and html (!!) files. Somebody should have noted this before. Still, changing this works for me...
In the function file_to_string()' in the file omindex.cc', a string variable `out' is filled with the contents of a file. However, after that nothing is done with the variable, since the empty string is returned. I think that is incorrect, and that at the last line of the function, `return "";' should be replaced by `return out;'.
Moreover, `file_to_string()' is used at two places, where a test
if( !out.empty() ){ <abort> }
is done. I think the `!' should be removed to restore the original intention of the code.
Finally, the C++ forbids mixing of new' and malloc' allocation, so the malloc' in file_to_string()' should be replaced by a `new []' expression.
