Skip to content

Commit

Permalink
Fix undeclared variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nineteendo committed Nov 13, 2024
1 parent 4d28f22 commit b774310
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions Python/fileutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -2510,6 +2510,8 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize,
#endif
#define SEP_OR_END(x) (IS_SEP(x) || IS_END(x))

Py_ssize_t drvsize, rootsize;
_Py_skiproot(path, size, &drvsize, &rootsize);
if (p1[0] == L'.' && IS_SEP(&p1[1])) {
// Skip leading '.\'
path = &path[2];
Expand All @@ -2520,29 +2522,25 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize,
lastC = SEP;
explicit = 1;
}
else {
Py_ssize_t drvsize, rootsize;
_Py_skiproot(path, size, &drvsize, &rootsize);
if (drvsize || rootsize) {
// Skip past root and update minP2
p1 = &path[drvsize + rootsize];
else if (drvsize || rootsize) {
// Skip past root and update minP2
p1 = &path[drvsize + rootsize];
#ifndef ALTSEP
p2 = p1;
p2 = p1;
#else
for (; p2 < p1; ++p2) {
if (*p2 == ALTSEP) {
*p2 = SEP;
}
for (; p2 < p1; ++p2) {
if (*p2 == ALTSEP) {
*p2 = SEP;
}
}
#endif
minP2 = p2 - 1;
lastC = *minP2;
minP2 = p2 - 1;
lastC = *minP2;
#ifdef MS_WINDOWS
if (lastC != SEP) {
minP2++;
}
#endif
if (lastC != SEP) {
minP2++;
}
#endif
}

/* if pEnd is specified, check that. Else, check for null terminator */
Expand Down

0 comments on commit b774310

Please sign in to comment.