Skip empty lines in favorites.txt (#1571)

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov 2022-08-11 18:16:47 +03:00 committed by GitHub
parent 874eb46c93
commit aab8ce5e3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,7 @@ uint16_t archive_favorites_count(void* context) {
break; break;
} }
if(!string_size(buffer)) { if(!string_size(buffer)) {
break; continue; // Skip empty lines
} }
++lines; ++lines;
} }
@ -93,7 +93,7 @@ static bool archive_favourites_rescan() {
break; break;
} }
if(!string_size(buffer)) { if(!string_size(buffer)) {
break; continue;
} }
if(string_search(buffer, "/app:") == 0) { if(string_search(buffer, "/app:") == 0) {
@ -152,7 +152,7 @@ bool archive_favorites_read(void* context) {
break; break;
} }
if(!string_size(buffer)) { if(!string_size(buffer)) {
break; continue;
} }
if(string_search(buffer, "/app:") == 0) { if(string_search(buffer, "/app:") == 0) {
@ -215,7 +215,7 @@ bool archive_favorites_delete(const char* format, ...) {
break; break;
} }
if(!string_size(buffer)) { if(!string_size(buffer)) {
break; continue;
} }
if(string_search(buffer, filename)) { if(string_search(buffer, filename)) {
@ -259,7 +259,7 @@ bool archive_is_favorite(const char* format, ...) {
break; break;
} }
if(!string_size(buffer)) { if(!string_size(buffer)) {
break; continue;
} }
if(!string_search(buffer, filename)) { if(!string_search(buffer, filename)) {
found = true; found = true;
@ -299,7 +299,7 @@ bool archive_favorites_rename(const char* src, const char* dst) {
break; break;
} }
if(!string_size(buffer)) { if(!string_size(buffer)) {
break; continue;
} }
archive_file_append( archive_file_append(