Skip to content

Commit 1cfc568

Browse files
committed
Remove duplicate code
1 parent 731bd72 commit 1cfc568

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

svcbatch.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -774,21 +774,12 @@ static wchar_t *getrealpathname(const wchar_t *path, int isdir)
774774
HANDLE fh;
775775
DWORD atr = isdir ? FILE_FLAG_BACKUP_SEMANTICS : FILE_ATTRIBUTE_NORMAL;
776776

777-
if (IS_EMPTY_WCS(path))
778-
return NULL;
779777
if (servicemode == 0)
780778
return xwcsdup(path);
781779

782-
if ((path[0] == L'.') && ((path[1] == L'\\') || (path[1] == L'/'))) {
783-
/**
784-
* Remove leading './' or '.\'
785-
*/
786-
path += 2;
787-
}
788-
buf = xwcsdup(path);
780+
buf = winrealpathname(path, isdir);
789781
if (IS_EMPTY_WCS(buf))
790782
return NULL;
791-
xcleanwinpath(buf, isdir);
792783

793784
fh = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, NULL,
794785
OPEN_EXISTING, atr, NULL);

0 commit comments

Comments
 (0)