summaryrefslogtreecommitdiff
authortille <tille>2002-07-24 11:22:45 (UTC)
committer tille <tille>2002-07-24 11:22:45 (UTC)
commit0948a167e4e46e6d2082809ec47be6a08a5de9d7 (patch) (unidiff)
tree31d9da85c68da2f2d4ca99a7ca3aaacce5ed72be
parent17068d35cc662a1cace883cfa98bb1f21534cb41 (diff)
downloadopie-0948a167e4e46e6d2082809ec47be6a08a5de9d7.zip
opie-0948a167e4e46e6d2082809ec47be6a08a5de9d7.tar.gz
opie-0948a167e4e46e6d2082809ec47be6a08a5de9d7.tar.bz2
fix #136 -- parse packagelist without a nl at eof
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagelist.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp
index 844f43f..998dae9 100644
--- a/noncore/unsupported/oipkg/packagelist.cpp
+++ b/noncore/unsupported/oipkg/packagelist.cpp
@@ -176,7 +176,7 @@ void PackageList::readFileEntries( QString filename, QString dest )
176 if ( !f.open(IO_ReadOnly) ) return; 176 if ( !f.open(IO_ReadOnly) ) return;
177 QTextStream *statusStream = new QTextStream( &f ); 177 QTextStream *statusStream = new QTextStream( &f );
178 while ( !statusStream ->eof() ) 178 while ( !statusStream ->eof() )
179 { 179 {
180 QString line = statusStream->readLine(); 180 QString line = statusStream->readLine();
181 if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) 181 if ( line.find(QRegExp("[\n\t ]*")) || line == "" )
182 { 182 {
@@ -195,6 +195,17 @@ void PackageList::readFileEntries( QString filename, QString dest )
195 packEntry << line; 195 packEntry << line;
196 }; 196 };
197 } 197 }
198 //there might be no nl at the end of the package file
199 if ( ! packEntry.isEmpty() )
200 {
201 Package *p = new Package( packEntry, settings );
202 if ( p )
203 {
204 p->setDest( dest );
205 insertPackage( p );
206 packEntry.clear();
207 }
208 }
198 delete statusStream; 209 delete statusStream;
199 return; 210 return;
200} 211}