Skip to content

Commit 7acb709

Browse files
author
Jean-François Larvoire
committed
Fixed a potential issue with a for /f command.
1 parent b87ffc0 commit 7acb709

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Batch/md2h.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424
:# 2020-07-03 JFL Added options -c & -t to select the github server to use. #
2525
:# Added option -t to use an authentication token. #
2626
:# Added option -s to use a given github server API URL. #
27+
:# 2023-01-10 JFL Fixed a potential issue with a `for /f` command. #
2728
:# #
2829
:# © Copyright 2019 Hewlett Packard Enterprise Development LP #
2930
:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 #
3031
:##############################################################################
3132

3233
setlocal EnableExtensions DisableDelayedExpansion
33-
set "VERSION=2020-07-03"
34+
set "VERSION=2023-01-10"
3435
set "SCRIPT=%~nx0" &:# Script name
3536
set "SNAME=%~n0" &:# Script name, without its extension
3637
set "SPATH=%~dp0" &:# Script path
@@ -180,7 +181,7 @@ echo # Converting %NXMD% using %SERVER%
180181
:# Load the authentication token from "%USERPROFILE%\.config\md2h\%SERVER%.txt" if present
181182
if not defined TOKEN (
182183
for %%f in ("%USERPROFILE%\.config\md2h\%SERVER%.txt") do if exist %%f (
183-
for /f "delims=" %%t in (%%~sf) do set "TOKEN=%%~t"
184+
for /f "usebackq delims=" %%t in ("%%~f") do set "TOKEN=%%~t"
184185
)
185186
)
186187

0 commit comments

Comments
 (0)