Modify

Opened 17 years ago

Closed 16 years ago

#1004 closed Bug (Fixed)

_PathFull bug in beta autoit 3.3.1

Reported by: godzail Owned by: J-Paul Mesnage
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 by Valik, 17 years ago

Milestone: 3.3.1.1
Owner: set to Valik
Resolution: Fixed
Status: newclosed

Fixed in version: 3.3.1.1

comment:2 by therks, 16 years ago

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 by Valik, 16 years ago

Milestone: 3.3.1.1
Resolution: Fixed
Status: closedreopened

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 by Rob Saunders <therks@…>, 16 years ago

(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 by Valik, 16 years ago

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 by J-Paul Mesnage, 16 years ago

Milestone: 3.3.1.2
Owner: changed from Valik to J-Paul Mesnage
Resolution: Fixed
Status: reopenedclosed

Fixed in version: 3.3.1.2

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.