summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2013-10-04 01:58:35 +0900
committerChunEon Park <hermet@hermet.pe.kr>2013-10-04 01:58:35 +0900
commit18be4c50d9990c82ed9ce4269b7820e61f772699 (patch)
treeb526ecde86529367c6710c5b8da14302602f5b09
parent44988e4798552cd97d14c8fc87959d1442a612b9 (diff)
downloadefl-18be4c50d9990c82ed9ce4269b7820e61f772699.tar.gz
eina/eina_file - fix eina_file_map_lines() to not drop of one character in the last line.
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/lib/eina/eina_file_common.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2444fdb920..cb4ea4ee4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-10-04 ChunEon Park (Hermet)
+
+ * Eina: fix eina_file_map_lines() to not drop of one character in the last line.
+
2013-10-02 Cedric Bail
* Eina: add eina_swap16(), eina_swap32(), eina_swap64().
diff --git a/NEWS b/NEWS
index cd3d9f25cc..fc83666916 100644
--- a/NEWS
+++ b/NEWS
@@ -258,6 +258,7 @@ Fixes:
- Fix memory leak in eina_xattr_value_ls.
- Fix magic failure in eina_value_array_count when array has not been allocated.
- Fix issue when wchar_t is signed and eina_unicode does negative array lookups.
+ - Eina: fix eina_file_map_lines() to not drop of one character in the last line.
* Eet:
- Fix PPC (big endian) image codec bug.
- Fix leak in eet_pbkdf2_sha1 with OpenSSL.
diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c
index 5d7ef11c47..ec9cac8a6e 100644
--- a/src/lib/eina/eina_file_common.c
+++ b/src/lib/eina/eina_file_common.c
@@ -543,7 +543,8 @@ _eina_file_map_lines_iterator_next(Eina_Lines_Iterator *it, void **data)
it->current.start = it->current.end;
it->current.end = eol;
- it->current.length = eol - it->current.start - 1;
+ it->current.length = eol - it->current.start;
+ if (eol < it->end) it->current.length--;
*data = &it->current;
return EINA_TRUE;