From 0948a167e4e46e6d2082809ec47be6a08a5de9d7 Mon Sep 17 00:00:00 2001 From: tille Date: Wed, 24 Jul 2002 11:22:45 +0000 Subject: fix #136 -- parse packagelist without a nl at eof --- 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 ) if ( !f.open(IO_ReadOnly) ) return; QTextStream *statusStream = new QTextStream( &f ); while ( !statusStream ->eof() ) - { + { QString line = statusStream->readLine(); if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) { @@ -195,6 +195,17 @@ void PackageList::readFileEntries( QString filename, QString dest ) packEntry << line; }; } + //there might be no nl at the end of the package file + if ( ! packEntry.isEmpty() ) + { + Package *p = new Package( packEntry, settings ); + if ( p ) + { + p->setDest( dest ); + insertPackage( p ); + packEntry.clear(); + } + } delete statusStream; return; } -- cgit v0.9.0.2