summaryrefslogtreecommitdiff
authordrw <drw>2003-03-28 01:27:02 (UTC)
committer drw <drw>2003-03-28 01:27:02 (UTC)
commit9e561f9fdd2bef09d21904aba0a74faa39165c04 (patch) (unidiff)
treee183734520a857a424d7e07c4bf0f0e7a35c90f8
parent79907dc7b9d89717b0d02f51a4094449e28eca6c (diff)
downloadopie-9e561f9fdd2bef09d21904aba0a74faa39165c04.zip
opie-9e561f9fdd2bef09d21904aba0a74faa39165c04.tar.gz
opie-9e561f9fdd2bef09d21904aba0a74faa39165c04.tar.bz2
Fix bug in reading feed's Package file
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/server.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp
index 04f5ab7..06b0863 100644
--- a/noncore/settings/aqpkg/server.cpp
+++ b/noncore/settings/aqpkg/server.cpp
@@ -156,30 +156,32 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR
156 QString key; 156 QString key;
157 QString value; 157 QString value;
158 158
159 if ( clearAll ) 159 if ( clearAll )
160 cleanUp(); 160 cleanUp();
161 Package *currPackage = 0; 161 Package *currPackage = 0;
162 162
163 bool newPackage = true; 163 bool newPackage = true;
164 do 164 do
165 { 165 {
166 in.getline( line, 1000 ); 166 in.getline( line, 1000 );
167 if ( in.eof() ) 167 if ( in.eof() )
168 continue; 168 break;
169 169
170 k[0] = '\0'; 170 k[0] = '\0';
171 v[0] = '\0'; 171 v[0] = '\0';
172 172
173 sscanf( line, "%[^:]: %[^\n]", k, v ); 173 if ( sscanf( line, "%[^:]: %[^\n]", k, v ) < 2 )
174 break;
175
174 key = k; 176 key = k;
175 value = v; 177 value = v;
176 key = key.stripWhiteSpace(); 178 key = key.stripWhiteSpace();
177 value = value.stripWhiteSpace(); 179 value = value.stripWhiteSpace();
178 if ( key == "Package" && newPackage ) 180 if ( key == "Package" && newPackage )
179 { 181 {
180 newPackage = false; 182 newPackage = false;
181 183
182 currPackage = getPackage( value ); 184 currPackage = getPackage( value );
183 if ( !currPackage ) 185 if ( !currPackage )
184 { 186 {
185 Package *package = new Package( value ); 187 Package *package = new Package( value );