Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

fogcreek shellext: fixed curly braces

Changeset ca343468d05b

Parent b24bad149059

by David Golub

Changes to 15 files · Browse files at ca343468d05b Showing diff from parent b24bad149059 Diff from another changeset...

 
27
28
29
 
30
 
31
 
32
 
33
 
34
 
35
36
37
 
45
46
47
48
49
 
50
51
52
 
56
57
58
59
60
 
61
62
63
 
136
137
138
139
140
 
141
142
143
 
185
186
187
188
189
 
190
191
192
 
225
226
227
228
 
 
229
230
231
232
 
 
233
234
235
 
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
51
52
53
 
 
54
55
56
57
 
61
62
63
 
 
64
65
66
67
 
140
141
142
 
 
143
144
145
146
 
188
189
190
 
 
191
192
193
194
 
227
228
229
 
230
231
232
233
234
 
235
236
237
238
239
@@ -27,11 +27,17 @@
  m_pParent(pParent), m_strName(strName)  {   if (strName.IsEmpty()) + {   m_strPath = strBasePath; + }   else if (strBasePath.IsEmpty()) + {   m_strPath = strName; + }   else + {   m_strPath = strBasePath + '/' + strName; + }  }    CDirectory::~CDirectory() @@ -45,8 +51,7 @@
   int SplitBase(const CString& strPath, CString& strBase, CString& strRest)  { - if (strPath.IsEmpty()) - return 0; + if (strPath.IsEmpty()) return 0;     int nPos = strPath.Find('/');   if (nPos == -1) @@ -56,8 +61,7 @@
  return 1;   }   - if (nPos == 0 || nPos == strPath.GetLength() - 1) - return 0; + if (nPos == 0 || nPos == strPath.GetLength() - 1) return 0;     strBase = strPath.Left(nPos);   strRest = strPath.Mid(nPos + 1); @@ -136,8 +140,7 @@
  while (position != NULL)   {   const CDirentry& rItem = pCur->m_listFiles.GetNext(position); - if (rItem.m_strName == strRelPath) - return &rItem; + if (rItem.m_strName == strRelPath) return &rItem;   }   return 0;   } @@ -185,8 +188,7 @@
  CDirectory* pItem = pCur->m_listSubdirs.GetNext(position);   if (pItem->m_strName == strSearch)   { - if (bLeaf) - return pItem; + if (bLeaf) return pItem;   pCur = pItem;   strRelPath = strRest;   goto loopstart; @@ -225,11 +227,13 @@
  rItem.m_strName);   t = rItem.m_uMTime;   errno_t err = ctime_s(ctime_res, 26, &t); - if (err == 0) { + if (err == 0) + {   str = ctime_res;   str.Truncate(str.GetLength() - 1); // strip ending '\n'   } - else { + else + {   str = "unset";   }   printf("%c %6o %10u %-24s %s\n", rItem.m_chState, rItem.m_uMode, rItem.m_uSize,
 
39
40
41
 
42
 
43
44
45
46
47
48
49
 
 
50
51
52
 
80
81
82
83
84
85
86
 
 
87
88
89
 
98
99
100
101
102
103
 
104
105
106
 
39
40
41
42
43
44
45
46
47
 
 
 
 
48
49
50
51
52
 
80
81
82
 
 
 
 
83
84
85
86
87
 
96
97
98
 
 
 
99
100
101
102
@@ -39,14 +39,14 @@
  break;   }   if (rEntry.chStatus == 'a') + {   bAdded = true; + }   }   }   - if (bModified) - return 'M'; - if (bAdded) - return 'A'; + if (bModified) return 'M'; + if (bAdded) return 'A';   return 'C';  }   @@ -80,10 +80,8 @@
    for (;;)   { - if (fread(&chStatus, sizeof(char), 1, pFile) != 1) - goto close; - if (chStatus == '\n') - break; + if (fread(&chStatus, sizeof(char), 1, pFile) != 1) goto close; + if (chStatus == '\n') break;   strLine.AppendChar(chStatus);   if (strLine.GetLength() > 1000)   { @@ -98,9 +96,7 @@
  goto close;   }   - if (strLine.IsEmpty()) - goto close; - + if (strLine.IsEmpty()) goto close;   e.chStatus = strLine[0];     CString strPath;
 
22
23
24
25
26
 
27
28
29
 
22
23
24
 
 
25
26
27
28
@@ -22,8 +22,7 @@
   int CDirentry::Read(FILE* pFile, CString& strRelPath)  { - if (fread(&m_chState, sizeof(char), 1, pFile) != 1) - return 0; + if (fread(&m_chState, sizeof(char), 1, pFile) != 1) return 0;     unsigned nLength = 0;  
 
40
41
42
43
44
45
46
47
 
 
48
49
50
 
71
72
73
74
 
 
75
76
77
 
40
41
42
 
 
 
 
 
43
44
45
46
47
 
68
69
70
 
71
72
73
74
75
@@ -40,11 +40,8 @@
  CString strRelPath;   while (e.Read(pFile, strRelPath))   { - if (e.Unset()) - bUnset = true; - - if (e.m_chState == 'a') - ++pd->m_nNumAdded; + if (e.Unset()) bUnset = true; + if (e.m_chState == 'a') ++pd->m_nNumAdded;     pd->Add(strRelPath, e);   } @@ -71,7 +68,8 @@
 {   bool bUnset;   CAutoPtr<CDirstate> pDirstate = CDirstate::Read(".hg/dirstate", bUnset); - if ((CDirstate*)pDirstate == NULL) { + if ((CDirstate*)pDirstate == NULL) + {   printf("error: could not read .hg/dirstate\n");   return;   }
 
37
38
39
40
41
 
42
43
44
 
94
95
96
97
98
 
99
100
101
 
102
103
104
 
157
158
159
160
161
 
162
163
164
 
37
38
39
 
 
40
41
42
43
 
93
94
95
 
 
96
97
 
 
98
99
100
101
 
154
155
156
 
 
157
158
159
160
@@ -37,8 +37,7 @@
  while (position != NULL)   {   CEntry& rItem = Cache().GetAt(position); - if (strHgRoot == rItem.strHgRoot && bUseKbfiles == rItem.bUseKbfiles) - break; + if (strHgRoot == rItem.strHgRoot && bUseKbfiles == rItem.bUseKbfiles) break;   Cache().GetNext(position);   }   @@ -94,11 +93,9 @@
  {   bUnset = rItem.bUnset;   - if (!bNewStat) - return rItem.pDirstate; + if (!bNewStat) return rItem.pDirstate;   - if (rItem.llMTime == stat.ullMTime - && rItem.llSize == stat.ullSize) + if (rItem.llMTime == stat.ullMTime && rItem.llSize == stat.ullSize)   {   return rItem.pDirstate;   } @@ -157,8 +154,7 @@
   void CDirstateCache::Invalidate(const CString& strHgRoot, bool bUseKbfiles)  { - if (strHgRoot.IsEmpty()) - return; + if (strHgRoot.IsEmpty()) return;     POSITION position = Cache().GetHeadPosition();   while (position != NULL)
 
49
50
51
52
53
 
54
55
56
 
60
61
62
63
64
 
65
66
67
68
 
69
70
71
 
86
87
88
89
90
 
91
92
93
 
107
108
109
110
111
 
112
113
114
 
49
50
51
 
 
52
53
54
55
 
59
60
61
 
 
62
63
64
 
 
65
66
67
68
 
83
84
85
 
 
86
87
88
89
 
103
104
105
 
 
106
107
108
109
@@ -49,8 +49,7 @@
   HBITMAP CIconBitmapUtils::IconToBitmap(HICON hIcon)  { - if (!hIcon) - return NULL; + if (!hIcon) return NULL;     RECT rect;   @@ -60,12 +59,10 @@
  rect.left = rect.top = 0;     HWND hwndDesktop = ::GetDesktopWindow(); - if (hwndDesktop == NULL) - return NULL; + if (hwndDesktop == NULL) return NULL;     HDC hScreenDC = ::GetDC(hwndDesktop); - if (hScreenDC == NULL) - return NULL; + if (hScreenDC == NULL) return NULL;     // Create a compatible DC   HDC hDestDC = ::CreateCompatibleDC(hScreenDC); @@ -86,8 +83,7 @@
    // Select it into the compatible DC   HBITMAP hOldBitmap = (HBITMAP)::SelectObject(hDestDC, hBitmap); - if (hOldBitmap == NULL) - return NULL; + if (hOldBitmap == NULL) return NULL;     // Fill the background of the compatible DC with the white color   // that is taken by menu routines as transparent @@ -107,8 +103,7 @@
   HBITMAP CIconBitmapUtils::IconToBitmapPARGB32(HICON hIcon)  { - if (!hIcon) - return NULL; + if (!hIcon) return NULL;     if (m_pfnBeginBufferedPaint == NULL || m_pfnEndBufferedPaint == NULL ||   m_pfnGetBufferedPaintBits == NULL)
 
21
22
23
24
25
 
26
27
28
 
31
32
33
34
35
 
36
37
38
39
40
 
41
42
43
 
 
 
44
45
46
 
21
22
23
 
 
24
25
26
27
 
30
31
32
 
 
33
34
35
36
37
38
39
40
 
 
41
42
43
44
45
46
@@ -21,8 +21,7 @@
 bool KilnGetUrl(const CString& strPath, CString* pstrKilnUrl)  {   CString strHgRoot; - if (!GetHgRoot(strPath, strHgRoot)) - return false; + if (!GetHgRoot(strPath, strHgRoot)) return false;     // Try to get the default path from hgrc.   CString strHgrcPath = strHgRoot + "\\.hg\\hgrc"; @@ -31,16 +30,17 @@
  DWORD nSize = ::GetPrivateProfileString("paths", "default", "", lpszBuf,   MAX_PATH, strHgrcPath);   strDefaultPath.ReleaseBuffer(nSize); - if (strDefaultPath.IsEmpty()) - return false; + if (strDefaultPath.IsEmpty()) return false;     // Check whether the repository is a Kiln repository.   CString strLower = strDefaultPath;   strLower.MakeLower();   if (strLower.Find("kilnhg.com/") == -1 && strLower.Find("/kiln/") == -1) + {   return false; - if (pstrKilnUrl != NULL) - *pstrKilnUrl = strDefaultPath; + } + + if (pstrKilnUrl != NULL) *pstrKilnUrl = strDefaultPath;   return true;  }  
 
46
47
48
49
50
 
51
52
53
54
55
 
56
57
58
 
187
188
189
190
191
192
193
194
195
196
197
 
 
 
198
199
200
 
204
205
206
207
208
 
209
210
211
 
226
227
228
229
230
231
232
233
 
 
234
235
236
 
243
244
245
246
247
 
248
249
250
 
267
268
269
270
271
 
272
273
274
 
283
284
285
286
287
 
288
289
290
 
365
366
367
368
369
 
370
371
372
 
380
381
382
383
384
 
385
386
387
 
46
47
48
 
 
49
50
51
52
 
 
53
54
55
56
 
185
186
187
 
 
 
 
 
 
 
 
188
189
190
191
192
193
 
197
198
199
 
 
200
201
202
203
 
218
219
220
 
 
 
 
 
221
222
223
224
225
 
232
233
234
 
 
235
236
237
238
 
255
256
257
 
 
258
259
260
261
 
270
271
272
 
 
273
274
275
276
 
351
352
353
 
 
354
355
356
357
 
365
366
367
 
 
368
369
370
371
@@ -46,13 +46,11 @@
    bool bRes = false;   - if (strPath.IsEmpty() || strPath == "\\") - return bRes; + if (strPath.IsEmpty() || strPath == "\\") return bRes;     CString strHgPath = strPath + "\\.hg";   - if (::PathIsUNCServerShare(strHgPath)) - return bRes; + if (::PathIsUNCServerShare(strHgPath)) return bRes;     unsigned tc0 = ::GetTickCount();   bRes = ::PathIsDirectory(strHgPath) != 0; @@ -187,14 +185,9 @@
 int GetRelPath(const CString& strHgRoot, const CString& strPath, CString& strRes)  {   int nOffset = strHgRoot.GetLength(); - if (nOffset == 0) - return 0; - - if (nOffset > strPath.GetLength()) - return 0; - - if (strPath[nOffset] == '\\') - nOffset++; + if (nOffset == 0) return 0; + if (nOffset > strPath.GetLength()) return 0; + if (strPath[nOffset] == '\\') nOffset++;     strRes = strPath.Mid(nOffset);   return 1; @@ -204,8 +197,7 @@
 {   static CQueryState qsLast;   - if (strPath.IsEmpty()) - return 0; + if (strPath.IsEmpty()) return 0;     CQueryState qsCur;   @@ -226,11 +218,8 @@
  return 0;   }   - if (FindHgRoot('0', qsCur, qsLast, bOutdated) == 0) - return 0; - - if (qsCur.strHgRoot.IsEmpty()) - return 0; + if (FindHgRoot('0', qsCur, qsLast, bOutdated) == 0) return 0; + if (qsCur.strHgRoot.IsEmpty()) return 0;     strHgRoot = qsCur.strHgRoot;   return 1; @@ -243,8 +232,7 @@
    static CQueryState qsLast;   - if (strPath.IsEmpty()) - return 0; + if (strPath.IsEmpty()) return 0;     CQueryState qsCur;   @@ -267,8 +255,7 @@
  return 0;   }   - if (FindHgRoot(chClass, qsCur, qsLast, bOutdated) == 0) - return 0; + if (FindHgRoot(chClass, qsCur, qsLast, bOutdated) == 0) return 0;     int nOffset = qsCur.strHgRoot.GetLength();   if (nOffset == 0) @@ -283,8 +270,7 @@
    for (int i = 0; i < strRelPath.GetLength(); ++i)   { - if (strRelPath[i] == '\\') - strRelPath.SetAt(i, '/'); + if (strRelPath[i] == '\\') strRelPath.SetAt(i, '/');   }     CDirectoryStatus* pDirStatus = CDirectoryStatus::Get(qsCur.strHgRoot, qsCur.strBaseDir); @@ -365,8 +351,7 @@
    chOutStatus = e->Status(stat);   - if (bUnset) - goto exit; + if (bUnset) goto exit;     bool bUpdate = false;   @@ -380,8 +365,7 @@
  char chBaseDirStatus = pDirStatus->Status(strRelBase);   ATLTRACE("%s chBaseDirStatus = '%c'\n", (LPCTSTR)dp, chBaseDirStatus);   - if (chBaseDirStatus != 'M') - bUpdate = true; + if (chBaseDirStatus != 'M') bUpdate = true;   }   }   else if (chOutStatus == 'P')
 
23
24
25
26
27
28
 
29
30
31
 
23
24
25
 
 
 
26
27
28
29
@@ -23,9 +23,7 @@
    HKEY hKey = 0;   LONG lRes = ::RegOpenKeyEx(HKEY_CURRENT_USER, lpszSubKey, 0, KEY_READ, &hKey); - - if (lRes != ERROR_SUCCESS || hKey == 0) - return 0; + if (lRes != ERROR_SUCCESS || hKey == 0) return 0;     DWORD cbData = MAX_PATH;   LPTSTR lpszData = strRes.GetBuffer(cbData);
 
22
23
24
25
26
 
27
28
29
 
32
33
34
35
36
37
 
38
39
40
 
22
23
24
 
 
25
26
27
28
 
31
32
33
 
 
 
34
35
36
37
@@ -22,8 +22,7 @@
 {   DWORD dwSize = 260;   char szBuf[260]; - if (!::GetUserName(szBuf, &dwSize)) - return ""; + if (!::GetUserName(szBuf, &dwSize)) return "";   CString strRes = "\\\\.\\pipe\\TortoiseHgRpcServer-bc0c27107423-";   strRes += szBuf;   return strRes; @@ -32,9 +31,7 @@
 int CTHgStatus::SendRequest(const CString& strRequest)  {   static const CString strPipeName = GetPipeName(); - - if (strPipeName.IsEmpty()) - return 0; + if (strPipeName.IsEmpty()) return 0;     BOOL fSuccess;   DWORD cbRead;
 
223
224
225
226
227
 
228
229
230
 
440
441
442
443
444
 
445
446
447
 
565
566
567
 
568
 
569
570
571
 
591
592
593
594
 
 
 
595
 
596
597
598
 
792
793
794
795
796
 
797
798
799
 
804
805
806
807
808
 
809
810
811
 
838
839
840
 
841
 
842
 
843
 
844
845
 
846
 
847
848
849
 
223
224
225
 
 
226
227
228
229
 
439
440
441
 
 
442
443
444
445
 
563
564
565
566
567
568
569
570
571
 
591
592
593
 
594
595
596
597
598
599
600
601
 
795
796
797
 
 
798
799
800
801
 
806
807
808
 
 
809
810
811
812
 
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
@@ -223,8 +223,7 @@
  (LPCWSTR)strSubKey);   }   - if (hKey) - ::RegCloseKey(hKey); + if (hKey) ::RegCloseKey(hKey);  }    void CTortoiseHgCmenuBase::InitMenuMaps(const CMenuDescription *pMenuDescs, int nCount) @@ -440,8 +439,7 @@
   void CTortoiseHgCmenuBase::TweakMenuForVista(HMENU hMenu)  { - if (!CSysInfo::IsVistaOrLater()) - return; + if (!CSysInfo::IsVistaOrLater()) return;     MENUINFO mi;   memset(&mi, 0, sizeof(MENUINFO)); @@ -565,7 +563,9 @@
  if (listPromoted.Find(strName) != NULL)   {   if ((strName == "kiln" || strName == "kilnfiles") && !KilnGetUrl(strCwd)) + {   continue; + }   InsertMenuItemByName(hMenu, strName, indexMenu++, idCmd++, idCmdFirst, L"Hg ");   }   } @@ -591,8 +591,11 @@
  CString strName = ppszEntries[i];   if (listPromoted.Find(strName) == NULL)   { - if ((strName == "kiln" || strName == "kilnfiles") && !KilnGetUrl(strCwd)) + if ((strName == "kiln" || strName == "kilnfiles") && + !KilnGetUrl(strCwd)) + {   continue; + }   InsertMenuItemByName(hSubMenu, strName, indexSubMenu++, idCmd++,   idCmdFirst, L"");   bIsSeparator = false; @@ -792,8 +795,7 @@
  case WM_MEASUREITEM:   {   MEASUREITEMSTRUCT* lpmis = (MEASUREITEMSTRUCT*)lParam; - if (lpmis == NULL) - break; + if (lpmis == NULL) break;   lpmis->itemWidth += 2;   if(lpmis->itemHeight < 16)   lpmis->itemHeight = 16; @@ -804,8 +806,7 @@
  case WM_DRAWITEM:   {   DRAWITEMSTRUCT* lpdis = (DRAWITEMSTRUCT*)lParam; - if (!lpdis || (lpdis->CtlType != ODT_MENU) || !lpdis->itemData) - break; //not for a menu + if (!lpdis || (lpdis->CtlType != ODT_MENU) || !lpdis->itemData) break;   ::DrawIconEx(lpdis->hDC, lpdis->rcItem.left - 16,   lpdis->rcItem.top + (lpdis->rcItem.bottom - lpdis->rcItem.top - 16) / 2,   (HICON)lpdis->itemData, 16, 16, 0, 0, DI_NORMAL); @@ -838,12 +839,18 @@
  strHgCmd = strDir + "\\hgtk.exe";   hFind = ::FindFirstFile(strHgCmd, &data);   if (hFind == INVALID_HANDLE_VALUE) + {   strHgCmd = strDir + "\\thg.cmd"; + }   else + {   ::FindClose(hFind); + }   }   else + {   ::FindClose(hFind); + }     strHgCmd = Quote(strHgCmd) + " --nofork " + strCmd;  
 
57
58
59
60
61
 
62
63
64
65
66
67
68
 
69
70
71
72
73
74
 
75
76
77
 
78
 
79
80
81
82
83
 
84
85
86
 
57
58
59
 
 
60
61
62
63
64
65
 
 
66
67
68
69
70
 
 
71
72
73
74
75
76
77
78
 
 
 
 
79
80
81
82
@@ -57,30 +57,26 @@
    if (GetRegistryConfig("LocalDisksOnly", strCval) != 0 && strCval != "0")   { - if (::PathIsNetworkPath(strPath)) - return S_FALSE; + if (::PathIsNetworkPath(strPath)) return S_FALSE;     if (strPath.GetLength() > 2 && strPath[1] == ':')   {   CString strDrive = "C:\\";   strDrive.SetAt(0, strPath[0]); - if (::GetDriveType(strDrive) == DRIVE_REMOTE) - return S_FALSE; + if (::GetDriveType(strDrive) == DRIVE_REMOTE) return S_FALSE;   }   }     char chFilterStatus = 0; - if (m_chTortoiseClass == 'A') - chFilterStatus = 'A'; + if (m_chTortoiseClass == 'A') chFilterStatus = 'A';     char chStatus = 0;   if (!HgQueryDirstate(m_chTortoiseClass, strPath, chFilterStatus, chStatus)) + {   return S_FALSE; + }   - if (chStatus == m_chTortoiseClass) - return S_OK; - - return S_FALSE; + return (chStatus == m_chTortoiseClass) ? S_OK : S_FALSE;  }    CTortoiseHgOverlay::CTortoiseHgOverlay(char chClass) :
 
26
27
28
29
30
 
31
32
33
 
36
37
38
39
40
 
41
42
43
 
26
27
28
 
 
29
30
31
32
 
35
36
37
 
 
38
39
40
41
@@ -26,8 +26,7 @@
  static CBitmapCache bmpcache;     const CBitmapCache::CPair* p = bmpcache.Lookup(strIconName); - if (p != NULL) - return p->m_value; + if (p != NULL) return p->m_value;     if (bmpcache.GetCount() > 200)   { @@ -36,8 +35,7 @@
  }     HICON hIcon = GetTortoiseIcon(strIconName); - if (!hIcon) - return 0; + if (!hIcon) return 0;     HBITMAP hBitmap = bmpUtils.IconToBitmapPARGB32(hIcon);   if (!hBitmap)
 
28
29
30
 
31
 
32
33
34
 
93
94
95
96
97
 
98
99
100
 
101
102
 
103
 
104
105
106
107
108
109
110
 
111
112
113
 
114
115
116
 
130
131
132
133
134
 
135
136
137
 
171
172
173
 
174
 
175
176
177
 
198
199
200
201
202
 
203
204
205
 
226
227
228
229
230
231
 
232
233
234
235
236
237
238
239
240
 
241
242
243
244
245
246
247
248
249
250
251
252
253
 
 
254
255
256
257
258
 
259
260
261
 
28
29
30
31
32
33
34
35
36
 
95
96
97
 
 
98
99
 
 
100
101
102
103
104
105
106
107
108
109
110
 
 
111
112
 
 
113
114
115
116
 
130
131
132
 
 
133
134
135
136
 
170
171
172
173
174
175
176
177
178
 
199
200
201
 
 
202
203
204
205
 
226
227
228
 
 
 
229
230
231
232
233
234
235
 
 
 
236
237
 
238
239
240
241
242
243
 
 
 
 
 
244
245
246
247
248
 
 
249
250
251
252
@@ -28,7 +28,9 @@
  LONG lpcbLonger = MAX_PATH * sizeof(TCHAR);     if (::RegQueryValue(hKey, lpszKeyName, lpszValue, &lpcbLonger) != ERROR_SUCCESS) + {   return ""; + }     return lpszValue;  } @@ -93,24 +95,22 @@
   CString DirName(const CString& strFileName)  { - if (strFileName.IsEmpty()) - return strFileName; + if (strFileName.IsEmpty()) return strFileName;   int nPos = strFileName.ReverseFind('\\'); - if (nPos == -1) - return ""; + if (nPos == -1) return "";   CString strDirName = strFileName.Left(nPos);   if (!strDirName.IsEmpty() && strDirName[strDirName.GetLength()-1] == ':') + {   strDirName.AppendChar('\\'); + }   return strDirName;  }    CString BaseName(const CString& strFileName)  { - if (strFileName.IsEmpty()) - return strFileName; + if (strFileName.IsEmpty()) return strFileName;   int nPos = strFileName.ReverseFind('\\'); - if (nPos == -1) - return strFileName; + if (nPos == -1) return strFileName;   return strFileName.Mid(nPos+1);  }   @@ -130,8 +130,7 @@
  CString strIconPath = thgdir + "\\icons\\" + strIconName;     const CIconCache::CPair* p = iconcache.Lookup(strIconName); - if (p != NULL) - return p->m_value; + if (p != NULL) return p->m_value;     if (iconcache.GetCount() > 200)   { @@ -171,7 +170,9 @@
  break;   }   else if (::PathIsDirectory(strHgDir)) + {   break; + }   CString strOldPath = strPath;   strPath = DirName(strPath);   if (strPath == strOldPath) @@ -198,8 +199,7 @@
  FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,   0, OPEN_EXISTING, 0, 0);   - if (hFile == INVALID_HANDLE_VALUE) - return 0; + if (hFile == INVALID_HANDLE_VALUE) return 0;     // get C runtime file descriptor from file handle   int fd = _open_osfhandle((intptr_t)hFile, _O_RDONLY); @@ -226,36 +226,27 @@
 int GetRegSZValueW(HKEY hKey, LPCWSTR lpszName, CStringW& strRes)  {   strRes = L""; - - if (!hKey) - return 0; + if (!hKey) return 0;     DWORD cbData = 600;   LPWSTR lpszData = strRes.GetBuffer(cbData);   LONG lRes = ::RegQueryValueExW(hKey, lpszName, 0, 0, (LPBYTE)lpszData, &cbData);   strRes.ReleaseBuffer(cbData);   - if (lRes == ERROR_SUCCESS) - return 1; - + if (lRes == ERROR_SUCCESS) return 1;   ATLTRACE(L"GetRegSZValueW('%s') failed\n", lpszName); -   return 0;  }    // true if a starts with b  bool StartsWith(const CString& strWhole, const CString& strPrefix)  { - if (strWhole.IsEmpty() || strPrefix.IsEmpty()) - return false; - - if (strPrefix.GetLength() > strWhole.GetLength()) - return false; + if (strWhole.IsEmpty() || strPrefix.IsEmpty()) return false; + if (strPrefix.GetLength() > strWhole.GetLength()) return false;     for (int i = 0; i < strPrefix.GetLength(); ++i)   { - if (strWhole[i] != strPrefix[i]) - return false; + if (strWhole[i] != strPrefix[i]) return false;   }     return true;
 
28
29
30
31
32
 
33
34
35
 
28
29
30
 
 
31
32
33
34
@@ -28,8 +28,7 @@
  HANDLE hFind;     hFind = ::FindFirstFile(lpszFile, &data); - if (hFind == INVALID_HANDLE_VALUE) - return -1; + if (hFind == INVALID_HANDLE_VALUE) return -1;   ::FindClose(hFind);     ullMTime = (((ULONGLONG)data.ftLastWriteTime.dwHighDateTime << 32) +