summaryrefslogtreecommitdiff
path: root/src/csvreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/csvreader.cpp')
-rw-r--r--src/csvreader.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/csvreader.cpp b/src/csvreader.cpp
index c63fe06..ef7a326 100644
--- a/src/csvreader.cpp
+++ b/src/csvreader.cpp
@@ -43,6 +43,9 @@ Bu::StrArray Bu::CsvReader::readLine()
43 43
44 Bu::FString sLine = sIn.readLine(); 44 Bu::FString sLine = sIn.readLine();
45 45
46 if( !sLine.isSet() )
47 return Bu::StrArray();
48
46 Bu::FString::iterator i = sLine.begin(); 49 Bu::FString::iterator i = sLine.begin();
47 50
48 aVals.append( sDecode( i ) ); 51 aVals.append( sDecode( i ) );
@@ -52,6 +55,8 @@ Bu::StrArray Bu::CsvReader::readLine()
52 if( *i == ',' ) 55 if( *i == ',' )
53 { 56 {
54 i++; 57 i++;
58 if( !i )
59 break;
55 aVals.append( sDecode( i ) ); 60 aVals.append( sDecode( i ) );
56 } 61 }
57 else 62 else
@@ -81,7 +86,11 @@ Bu::FString Bu::CsvReader::decodeExcel( Bu::FString::iterator &i )
81 if( *i == '\"' ) 86 if( *i == '\"' )
82 { 87 {
83 i++; 88 i++;
84 if( *i == '\"' ) 89 if( !i )
90 {
91 return sRet;
92 }
93 else if( *i == '\"' )
85 { 94 {
86 sRet += *i; 95 sRet += *i;
87 } 96 }