Opened 15 years ago
Closed 15 years ago
#1004 closed Bug (Fixed)
_PathFull bug in beta autoit 3.3.1
Reported by: | godzail | Owned by: | Jpm |
---|---|---|---|
Milestone: | 3.3.1.2 | Component: | AutoIt |
Version: | 3.3.1.0 | Severity: | None |
Keywords: | Cc: |
Description
I tried the example in the help file for the function _PathFull but I received in output a wrong path.
--For example, if I run the example:
#include <file.au3>
;~ $TestPath = _PathFull("..\..\test")
$TestPath = _PathFull(@ScriptDir & "..\..\test")
ConsoleWrite(@ScriptDir & @lf & $TestPath & @CRLF)
result with autoit vers. 3.3.0 (OK):
C:\Program Files\AutoIt3\Beta\Examples\Helpfile
C:\Program Files\AutoIt3\Beta\Examples\test
result with autoit vers. 3.3.1 (WRONG):
C:\Program Files\AutoIt3\Beta\Examples\Helpfile
C:\Program Files\AutoIt3\Beta\Examples\Helpfile\Program Files\AutoIt3\Beta\Examples\test
-- If I add a backslash as you suggest ( $TestPath = _PathFull(@ScriptDir & "\..\..\test") )
result with autoit vers. 3.3.0 (OK):
C:\Program Files\AutoIt3\Beta\Examples\Helpfile
C:\Program Files\AutoIt3\Beta\test
result with autoit vers. 3.3.1 (WRONG):
C:\Program Files\AutoIt3\Beta\Examples\Helpfile
C:\Program Files\AutoIt3\Beta\Examples\Helpfile\Program Files\AutoIt3\Beta\test
-- it seems that the path contains a repeat of the main folder and subfolders.
Attachments (0)
Change History (6)
comment:1 Changed 15 years ago by Valik
- Milestone set to 3.3.1.1
- Owner set to Valik
- Resolution set to Fixed
- Status changed from new to closed
comment:2 Changed 15 years ago by therks
It seems the bug is not completely fixed. For UNC paths it repeats the network name.
#include <File.au3> ConsoleWrite(_PathFull('\\NETWORK\Path\File.ext'))
Outputs:
NETWORK\NETWORK\Path\File.ext
I guess we can't reopen tickets anymore? I haven't been around in a long time and didn't realize...
comment:3 Changed 15 years ago by Valik
- Milestone 3.3.1.1 deleted
- Resolution Fixed deleted
- Status changed from closed to reopened
Sigh. This function is about to go the way of _StringAddThousandsSep(). Either I'm adding some obscure functionality or I'm fixing bugs that result from changing otherwise stable code.
Anyway, anonymous users could open tickets for all of a week or something. That's when it became apparent that people who didn't have any business being alive couldn't be trusted with the responsibility to manage a ticket's state.
comment:4 Changed 15 years ago by Rob Saunders <therks@…>
(that was me earlier)
Oh, please don't remove it! I quite like having the function there. I was going to attempt to fix it myself but I just got bogged down and confused. One thing I did notice, if it means anything, is that on line 487 the function is called recursively but fails to pass along the second parameter:
If StringInStr($sFullPath, "..") Then $sFullPath = _PathFull($sFullPath)
I assumed it should be:
If StringInStr($sFullPath, "..") Then $sFullPath = _PathFull($sFullPath, $sBasePath)
I know that doesn't fix the bug itself but I thought I would point it out. And is it just me, or does the error check on line 451 seem kind of redundant? I mean, is there really any way that $i could end up being 3?
comment:5 Changed 15 years ago by Valik
Looking at the code I think it's still possible to pass absolute garbage that can't be sensibly handled which the strange error check will catch. I'll take a look at the rest of the comments.
comment:6 Changed 15 years ago by Jpm
- Milestone set to 3.3.1.2
- Owner changed from Valik to Jpm
- Resolution set to Fixed
- Status changed from reopened to closed
Fixed in version: 3.3.1.2
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
Fixed in version: 3.3.1.1