Skip to content

Commit 0713512

Browse files
committed
Fix naming
1 parent b383b36 commit 0713512

1 file changed

Lines changed: 37 additions & 37 deletions

File tree

lib/pathmatch.h

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -159,28 +159,28 @@ class PathMatch::PathIterator {
159159
}
160160

161161
/* Constructor */
162-
explicit PathIterator(const char *path_a = nullptr, const char *path_b = nullptr, bool lowercase = false) :
163-
s{path_a, path_b}, lcase(lowercase)
162+
explicit PathIterator(const char *path_a = nullptr, const char *path_b = nullptr, bool lower = false) :
163+
mStart{path_a, path_b}, mLower(lower)
164164
{
165165
for (int i = 0; i < 2; i++) {
166-
e[i] = s[i];
166+
mEnd[i] = mStart[i];
167167

168-
if (s[i] == nullptr || *s[i] == '\0')
168+
if (mStart[i] == nullptr || *mStart[i] == '\0')
169169
continue;
170170

171-
if (st.l != 0)
172-
st.l++;
171+
if (mPos.l != 0)
172+
mPos.l++;
173173

174-
while (*e[i] != '\0') {
175-
e[i]++;
176-
st.l++;
174+
while (*mEnd[i] != '\0') {
175+
mEnd[i]++;
176+
mPos.l++;
177177
}
178178

179-
st.p = e[i];
179+
mPos.p = mEnd[i];
180180
}
181181

182-
if (st.l == 0)
183-
st.c = '\0';
182+
if (mPos.l == 0)
183+
mPos.c = '\0';
184184

185185
skips(false);
186186
}
@@ -198,13 +198,13 @@ class PathMatch::PathIterator {
198198
/* Save the current position */
199199
const Pos &getpos() const
200200
{
201-
return st;
201+
return mPos;
202202
}
203203

204204
/* Restore a saved position */
205205
void setpos(const Pos &pos)
206206
{
207-
st = pos;
207+
mPos = pos;
208208
}
209209

210210
/* Read the current character */
@@ -236,15 +236,15 @@ class PathMatch::PathIterator {
236236
/* Read the current character */
237237
char current() const
238238
{
239-
if (st.c != EOF)
240-
return st.c;
239+
if (mPos.c != EOF)
240+
return mPos.c;
241241

242-
char c = st.p[-1];
242+
char c = mPos.p[-1];
243243

244244
if (c == '\\')
245245
return '/';
246246

247-
if (lcase)
247+
if (mLower)
248248
return std::tolower(c);
249249

250250
return c;
@@ -253,8 +253,8 @@ class PathMatch::PathIterator {
253253
/* Do canonicalization on a path component boundary */
254254
void skips(bool leadsep)
255255
{
256-
while (st.l != 0) {
257-
Pos rst = st;
256+
while (mPos.l != 0) {
257+
Pos pos = mPos;
258258

259259
if (leadsep) {
260260
if (current() != '/')
@@ -273,7 +273,7 @@ class PathMatch::PathIterator {
273273
/* Skip '<name>/../' */
274274
nextc();
275275
skips(false);
276-
while (st.l != 0 && current() != '/')
276+
while (mPos.l != 0 && current() != '/')
277277
nextc();
278278
continue;
279279
}
@@ -284,14 +284,14 @@ class PathMatch::PathIterator {
284284
/* Skip leading './' */
285285
break;
286286
}
287-
} else if (c == '/' && st.l != 1) {
287+
} else if (c == '/' && mPos.l != 1) {
288288
/* Skip double separator (keep root) */
289289
nextc();
290290
leadsep = false;
291291
continue;
292292
}
293293

294-
st = rst;
294+
mPos = pos;
295295
break;
296296
}
297297
}
@@ -308,32 +308,32 @@ class PathMatch::PathIterator {
308308
/* Go to the next character */
309309
void nextc()
310310
{
311-
if (st.l == 0)
311+
if (mPos.l == 0)
312312
return;
313313

314-
st.l--;
314+
mPos.l--;
315315

316-
if (st.l == 0)
317-
st.c = '\0';
318-
else if (st.c != EOF) {
319-
st.c = EOF;
316+
if (mPos.l == 0)
317+
mPos.c = '\0';
318+
else if (mPos.c != EOF) {
319+
mPos.c = EOF;
320320
} else {
321-
st.p--;
322-
if (st.p == s[1]) {
323-
st.p = e[0];
324-
st.c = '/';
321+
mPos.p--;
322+
if (mPos.p == mStart[1]) {
323+
mPos.p = mEnd[0];
324+
mPos.c = '/';
325325
}
326326
}
327327
}
328328

329329
/* String start pointers */
330-
const char *s[2] {};
330+
const char *mStart[2] {};
331331
/* String end pointers */
332-
const char *e[2] {};
332+
const char *mEnd[2] {};
333333
/* Current position */
334-
Pos st {};
334+
Pos mPos {};
335335
/* Lowercase conversion flag */
336-
bool lcase;
336+
bool mLower;
337337
};
338338

339339
/// @}

0 commit comments

Comments
 (0)