michael-hoke commented on code in PR #706:
URL: https://github.com/apache/daffodil-vscode/pull/706#discussion_r1271129122


##########
src/adapter/activateDaffodilDebug.ts:
##########
@@ -52,7 +52,18 @@ async function getFile(fileRequested, label, title) {
       })
       .then((fileUri) => {
         if (fileUri && fileUri[0]) {
-          return fileUri[0].fsPath
+          let path = fileUri[0].fsPath
+
+          if (
+            process.platform === 'win32' &&
+            path.charCodeAt(0) > 97 &&
+            path.charCodeAt(0) <= 122 &&
+            path.charAt(1) === ':'

Review Comment:
   I see what you're saying now - adding the length check is definitely a good 
idea, but I'm not seeing the reason for moving the `charAt(1) === ':'` above 
the drive letter check.
   
   The path that makes it here comes from a file dialog, which should mean that 
it has been validated. For the short circuit to save us from the other checks, 
that validated path would have to have a lowercase ascii character as the first 
character and something other than a colon as the second character. Is that any 
more likely than a validated path that has a non-alphabetical character as the 
first character and a colon as the second?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to