~ubuntu-branches/ubuntu/utopic/unrar-nonfree/utopic-updates

« back to all changes in this revision

Viewing changes to match.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Meredith
  • Date: 2008-06-16 19:21:24 UTC
  • mfrom: (1.1.8 upstream) (5.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080616192124-1yg3uz2gh8xy36pc
Tags: 1:3.8.2-1
* New upstream release (Closes: #485490)
* Upstream fixed issue with not listening for /dev/null on stdin
                                                  (Closes: #452805)
* Bumped standards version
* Bumped debhelper version
* Fixed manpage hyphen problem
* Added DM-Upload-Allowed Control Field

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
static int mstricompc(const char *Str1,const char *Str2,bool ForceCase);
7
7
static int mstricompcw(const wchar *Str1,const wchar *Str2,bool ForceCase);
8
 
static int mstrnicompc(const char *Str1,const char *Str2,int N,bool ForceCase);
9
 
static int mstrnicompcw(const wchar *Str1,const wchar *Str2,int N,bool ForceCase);
 
8
static int mstrnicompc(const char *Str1,const char *Str2,size_t N,bool ForceCase);
 
9
static int mstrnicompcw(const wchar *Str1,const wchar *Str2,size_t N,bool ForceCase);
10
10
 
11
11
inline uint toupperc(byte ch,bool ForceCase)
12
12
{
13
13
  if (ForceCase)
14
14
    return(ch);
15
15
#ifdef _WIN_32
16
 
  return((uint)CharUpper((LPTSTR)(ch)));
 
16
  return((uint)(LPARAM)CharUpper((LPTSTR)(ch)));
17
17
#elif defined(_UNIX)
18
18
  return(ch);
19
19
#else
42
42
  
43
43
  if (CmpPath!=MATCH_NAMES)
44
44
  {
45
 
    int WildLength=strlen(Wildcard);
 
45
    size_t WildLength=strlen(Wildcard);
46
46
    if (CmpPath!=MATCH_EXACTPATH && mstrnicompc(Wildcard,Name,WildLength,ForceCase)==0)
47
47
    {
48
48
      char NextCh=Name[WildLength];
71
71
  }
72
72
  char *Name1=PointToName(Wildcard);
73
73
  char *Name2=PointToName(Name);
 
74
 
 
75
  // always return false for RAR temporary files to exclude them
 
76
  // from archiving operations
74
77
  if (mstrnicompc("__rar_",Name2,6,false)==0)
75
78
    return(false);
 
79
 
76
80
  return(match(Name1,Name2,ForceCase));
77
81
}
78
82
 
86
90
 
87
91
  if (CmpPath!=MATCH_NAMES)
88
92
  {
89
 
    int WildLength=strlenw(Wildcard);
 
93
    size_t WildLength=strlenw(Wildcard);
90
94
    if (CmpPath!=MATCH_EXACTPATH && mstrnicompcw(Wildcard,Name,WildLength,ForceCase)==0)
91
95
    {
92
96
      wchar NextCh=Name[WildLength];
113
117
  }
114
118
  wchar *Name1=PointToName(Wildcard);
115
119
  wchar *Name2=PointToName(Name);
 
120
 
 
121
  // always return false for RAR temporary files to exclude them
 
122
  // from archiving operations
116
123
  if (mstrnicompcw(L"__rar_",Name2,6,false)==0)
117
124
    return(false);
 
125
 
118
126
  return(match(Name1,Name2,ForceCase));
119
127
}
120
128
#endif
236
244
#endif
237
245
 
238
246
 
239
 
int mstrnicompc(const char *Str1,const char *Str2,int N,bool ForceCase)
 
247
int mstrnicompc(const char *Str1,const char *Str2,size_t N,bool ForceCase)
240
248
{
241
249
  if (ForceCase)
242
250
    return(strncmp(Str1,Str2,N));
249
257
 
250
258
 
251
259
#ifndef SFX_MODULE
252
 
int mstrnicompcw(const wchar *Str1,const wchar *Str2,int N,bool ForceCase)
 
260
int mstrnicompcw(const wchar *Str1,const wchar *Str2,size_t N,bool ForceCase)
253
261
{
254
262
  if (ForceCase)
255
263
    return(strncmpw(Str1,Str2,N));