Ignore:
Timestamp:
Jan 6, 2000, 9:08:06 PM (26 years ago)
Author:
sandervl
Message:

CRTDLLwcsnicmp fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/crtdll/crt.cpp

    r2198 r2346  
    1 /* $Id: crt.cpp,v 1.3 1999-12-24 18:40:41 sandervl Exp $ */
     1/* $Id: crt.cpp,v 1.4 2000-01-06 20:08:06 sandervl Exp $ */
    22
    33/*
    44 * Project Odin Software License can be found in LICENSE.TXT
    55 * Win32 NT Runtime / NTDLL for OS/2
     6 *
    67 * Copyright 1999 Patrick Haller (phaller@gmx.net)
     8 * Copyright 1999 Alexandre Julliard (CRTDLL__wcsnicmp)
     9 *
    710 */
    811
     
    107110 *****************************************************************************/
    108111
    109 int CDECL CRTDLL__wcsnicmp(LPWSTR str1, LPWSTR str2, long l)
    110 {
    111   LPWSTR w1;
    112   LPWSTR w2;
    113 
     112int CDECL CRTDLL__wcsnicmp(LPWSTR str1, LPWSTR str2, long n)
     113{
    114114  dprintf2(("CRTDLL: _wcsnicmp(%08xh,%08xh,%08xh)\n",
    115115           str1,
     
    117117           l));
    118118
    119   w1 = HEAP_strdupW(GetProcessHeap(),0,str1);
    120   w2 = HEAP_strdupW(GetProcessHeap(),0,str2);
    121   CRTDLL__wcsupr(w1);
    122   CRTDLL__wcsupr(w2);
    123 
    124   return (wcsncmp((wchar_t*)w1,
    125                   (wchar_t*)w2,
    126                   l));
     119    if (!n) return 0;
     120    while ((--n > 0) && *str1 && (towupper(*str1) == towupper(*str2)))
     121    {
     122        str1++;
     123        str2++;
     124    }
     125    return towupper(*str1) - towupper(*str2);
    127126}
    128127
Note: See TracChangeset for help on using the changeset viewer.