mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
Process extra empty lines correctly.
This commit is contained in:
parent
3dd4f5ed69
commit
a7512d74fa
@ -769,7 +769,11 @@ void write_status_file(deb_file_t **deb_file)
|
||||
|
||||
/* Update previously known packages */
|
||||
while ((control_buffer = fgets_str(old_status_file, "\n\n")) != NULL) {
|
||||
tmp_string = strstr(control_buffer, "Package:") + 8;
|
||||
if ((tmp_string = strstr(control_buffer, "Package:")) == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
tmp_string += 8;
|
||||
tmp_string += strspn(tmp_string, " \n\t");
|
||||
package_name = xstrndup(tmp_string, strcspn(tmp_string, "\n\0"));
|
||||
write_flag = FALSE;
|
||||
|
6
dpkg.c
6
dpkg.c
@ -769,7 +769,11 @@ void write_status_file(deb_file_t **deb_file)
|
||||
|
||||
/* Update previously known packages */
|
||||
while ((control_buffer = fgets_str(old_status_file, "\n\n")) != NULL) {
|
||||
tmp_string = strstr(control_buffer, "Package:") + 8;
|
||||
if ((tmp_string = strstr(control_buffer, "Package:")) == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
tmp_string += 8;
|
||||
tmp_string += strspn(tmp_string, " \n\t");
|
||||
package_name = xstrndup(tmp_string, strcspn(tmp_string, "\n\0"));
|
||||
write_flag = FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user