From c191a1d44dc4464ed7c6c69b03253d239f17743e Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 4 Apr 2019 16:00:50 +0200 Subject: [PATCH] wineps.drv: Don't use strcasecmp. Signed-off-by: Piotr Caban Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/wineps.drv/builtin.c | 3 ++- dlls/wineps.drv/font.c | 5 +++-- dlls/wineps.drv/mkagl.c | 4 ++-- dlls/wineps.drv/ppd.c | 21 +++++++++++---------- dlls/wineps.drv/type1afm.c | 7 ++++--- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/dlls/wineps.drv/builtin.c b/dlls/wineps.drv/builtin.c index e2106d320b7..75485cd6031 100644 --- a/dlls/wineps.drv/builtin.c +++ b/dlls/wineps.drv/builtin.c @@ -28,6 +28,7 @@ #include "winerror.h" #include "wingdi.h" #include "winnls.h" +#include "winternl.h" #include "psdrv.h" #include "wine/debug.h" @@ -168,7 +169,7 @@ BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont, /* Look for a matching font family */ for(family = physDev->pi->Fonts; family; family = family->next) { - if(!strcasecmp(FaceName, family->FamilyName)) + if(!_strnicmp(FaceName, family->FamilyName, -1)) break; } diff --git a/dlls/wineps.drv/font.c b/dlls/wineps.drv/font.c index c8ec97695c4..5c5033cec71 100644 --- a/dlls/wineps.drv/font.c +++ b/dlls/wineps.drv/font.c @@ -27,6 +27,7 @@ #include "wingdi.h" #include "winnls.h" #include "winspool.h" +#include "winternl.h" #include "psdrv.h" #include "wine/debug.h" @@ -93,8 +94,8 @@ HFONT PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) for (i = 0; i < physDev->pi->FontSubTableSize; ++i) { - if (!strcasecmp (FaceName, - physDev->pi->FontSubTable[i].pValueName)) + if (!_strnicmp (FaceName, + physDev->pi->FontSubTable[i].pValueName, -1)) { TRACE ("substituting facename '%s' for '%s'\n", (LPSTR) physDev->pi->FontSubTable[i].pData, FaceName); diff --git a/dlls/wineps.drv/mkagl.c b/dlls/wineps.drv/mkagl.c index f8919e3df90..788fb6ee77b 100644 --- a/dlls/wineps.drv/mkagl.c +++ b/dlls/wineps.drv/mkagl.c @@ -190,8 +190,8 @@ static void read_afms(FILE *f_c, FILE *f_h) char *cp, linebuf[256], font_family[128]; int i, num_metrics; - cp = strrchr(de->d_name, '.'); /* Does it end in */ - if (cp == NULL || strcasecmp(cp, ".afm") != 0) /* .afm or .AFM? */ + cp = strrchr(de->d_name, '.'); /* Does it end in */ + if (cp == NULL || _strnicmp(cp, ".afm", -1) != 0) /* .afm or .AFM? */ continue; f = fopen(de->d_name, "r"); diff --git a/dlls/wineps.drv/ppd.c b/dlls/wineps.drv/ppd.c index f8de57bf3fe..08d07b89644 100644 --- a/dlls/wineps.drv/ppd.c +++ b/dlls/wineps.drv/ppd.c @@ -30,6 +30,7 @@ #include #include "windef.h" #include "winbase.h" +#include "winternl.h" #include "wine/debug.h" #include "psdrv.h" @@ -748,7 +749,7 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer ) } else if(!strcmp("*ColorDevice", tuple.key)) { - if(!strcasecmp(tuple.value, "true")) + if(!_strnicmp(tuple.value, "true", -1)) ppd->ColorDevice = CD_True; else ppd->ColorDevice = CD_False; @@ -966,13 +967,13 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer ) } else if(!strcmp("*TTRasterizer", tuple.key)) { - if(!strcasecmp("None", tuple.value)) + if(!_strnicmp("None", tuple.value, -1)) ppd->TTRasterizer = RO_None; - else if(!strcasecmp("Accept68K", tuple.value)) + else if(!_strnicmp("Accept68K", tuple.value, -1)) ppd->TTRasterizer = RO_Accept68K; - else if(!strcasecmp("Type42", tuple.value)) + else if(!_strnicmp("Type42", tuple.value, -1)) ppd->TTRasterizer = RO_Type42; - else if(!strcasecmp("TrueImage", tuple.value)) + else if(!_strnicmp("TrueImage", tuple.value, -1)) ppd->TTRasterizer = RO_TrueImage; else { FIXME("Unknown option %s for *TTRasterizer\n", @@ -988,14 +989,14 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer ) duplex->Name = tuple.option; duplex->FullName = tuple.opttrans; duplex->InvocationString = tuple.value; - if(!strcasecmp("None", tuple.option) || !strcasecmp("False", tuple.option) - || !strcasecmp("Simplex", tuple.option)) + if(!_strnicmp("None", tuple.option, -1) || !_strnicmp("False", tuple.option, -1) + || !_strnicmp("Simplex", tuple.option, -1)) duplex->WinDuplex = DMDUP_SIMPLEX; - else if(!strcasecmp("DuplexNoTumble", tuple.option)) + else if(!_strnicmp("DuplexNoTumble", tuple.option, -1)) duplex->WinDuplex = DMDUP_VERTICAL; - else if(!strcasecmp("DuplexTumble", tuple.option)) + else if(!_strnicmp("DuplexTumble", tuple.option, -1)) duplex->WinDuplex = DMDUP_HORIZONTAL; - else if(!strcasecmp("Notcapable", tuple.option)) + else if(!_strnicmp("Notcapable", tuple.option, -1)) duplex->WinDuplex = 0; else { FIXME("Unknown option %s for *Duplex defaulting to simplex\n", tuple.option); diff --git a/dlls/wineps.drv/type1afm.c b/dlls/wineps.drv/type1afm.c index f9a8bcbcf97..19bb2d36eb2 100644 --- a/dlls/wineps.drv/type1afm.c +++ b/dlls/wineps.drv/type1afm.c @@ -48,6 +48,7 @@ #include "winerror.h" #include "winreg.h" #include "winnls.h" +#include "winternl.h" #include "psdrv.h" #include "wine/debug.h" @@ -464,7 +465,7 @@ static BOOL ReadFixedPitch(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, return TRUE; } - if (strcasecmp(sz, "false") == 0) + if (_strnicmp(sz, "false", -1) == 0) { afm->IsFixedPitch = FALSE; *p_found = TRUE; @@ -472,7 +473,7 @@ static BOOL ReadFixedPitch(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, return TRUE; } - if (strcasecmp(sz, "true") == 0) + if (_strnicmp(sz, "true", -1) == 0) { afm->IsFixedPitch = TRUE; *p_found = TRUE; @@ -1142,7 +1143,7 @@ static BOOL ReadAFMDir(LPCSTR dirname) CHAR *file_extension = strchr(dent->d_name, '.'); int fn_len; - if (file_extension == NULL || strcasecmp(file_extension, ".afm") != 0) + if (file_extension == NULL || _strnicmp(file_extension, ".afm", -1) != 0) continue; fn_len = snprintf(filename, 256, "%s/%s", dirname, dent->d_name);