typo in hplip-model-mismatch.patch causes regression for 1772698

This commit is contained in:
Zdenek Dohnal 2020-08-24 12:18:11 +02:00
parent 8f59268dca
commit 80149bea94
2 changed files with 12 additions and 7 deletions

View File

@ -26,7 +26,7 @@ index 20df27a..7ed4918 100644
{
stat = HPMUD_R_INVALID_URI; /* different device plugged in */
diff --git a/io/hpmud/model.c b/io/hpmud/model.c
index d546ec1..5bb6091 100644
index d546ec1..d1809a9 100644
--- a/io/hpmud/model.c
+++ b/io/hpmud/model.c
@@ -407,7 +407,10 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
@ -41,22 +41,24 @@ index d546ec1..5bb6091 100644
if ((fp = fopen(datFile, "r")) == NULL)
goto bugout;
@@ -422,10 +425,16 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
@@ -420,12 +423,18 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
if (rcbuf[0] == '[')
{
strncpy(section, rcbuf+1, sizeof(section)); /* found new section */
n = strlen(section);
- n = strlen(section);
section[n-2]=0; /* remove ']' and CR */
- if (strcasecmp(model, section) == 0 ||
+ n = strlen(section);
if (strcasecmp(model, section) == 0 ||
- (section[0] == 'h' && section[1] == 'p' &&
- section[2] == '_' &&
- strcasecmp(model, section + 3) == 0))
+ if ((strcasecmp(model, section) == 0) ||
+ (section[0] == 'h' &&
+ section[1] == 'p' &&
+ section[2] == '_' &&
+ strcasecmp(model, section + 3) == 0) ||
+ (n > model_len &&
+ strncasecmp(section, model, model_len) == 0 &&
+ strncasecmp(section + model_len, "_series", strlen("_series") == 0)
+ strncasecmp(section + model_len, "_series", strlen("_series")) == 0
+ )
+ )
{

View File

@ -7,7 +7,7 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.20.6
Release: 7%{?dist}
Release: 8%{?dist}
License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC
Url: https://developers.hp.com/hp-linux-imaging-and-printing
@ -738,6 +738,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
%changelog
* Mon Aug 24 2020 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.6-8
- typo in hplip-model-mismatch.patch causes regression for 1772698
* Wed Aug 05 2020 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.6-7
- don't build gui for newer RHELs