AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Last version 1.0.44.14 breaks CMDRet function

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
jordis



Joined: 30 Jul 2004
Posts: 78

PostPosted: Tue Oct 31, 2006 12:57 pm    Post subject: Last version 1.0.44.14 breaks CMDRet function Reply with quote

Hi Chris
just in case you watch this forum more closely, I though I would report it here.
My original post was in http://www.autohotkey.com/forum/viewtopic.php?p=85700#85700
Basically, it seems that last version 1.0.44.14 breaks corrupt's CMDRet function
It works perfectly using version 1.0.43.11
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10474

PostPosted: Tue Oct 31, 2006 1:16 pm    Post subject: Reply with quote

This might be the same issue reported previously at http://www.autohotkey.com/forum/viewtopic.php?t=13468
(hopefully the solution mentioned there will work in this case).

Please let me know if that's insufficient or if it appears to be a bug in AutoHotkey rather than the script. Also, if anyone can point out the exact modification to make to the script, let me know and I'll update it (I don't think Corrupt would mind).

Thanks.
Back to top
View user's profile Send private message Send e-mail
rogerg (not logged in)
Guest





PostPosted: Thu Nov 02, 2006 11:46 am    Post subject: Last version 1.0.44.14 breaks CMDRet function Reply with quote

I can verify that v1.0.44.14 did indeed break CMDRET, but with the
addition of the line VarSetCapacity(CMDout, -1) after line 80
in file cmdret_ahk_108.ahk, the breakage was repaired.

Code:
 ; new code snippet starting at line 78:
        VarSetCapacity(CMDout, (CMsize + 1), 0)
        CMDout=a   
        DllCall("RtlMoveMemory", "UInt", &CMDout, "UInt", &CMcpy, "Int", CMsize)
        VarSetCapacity(CMDout, -1)   ; fix required by change in autohotkey v1.0.44.14
      }
    }


Interestingly this combination of v1.0.44.14 and the added line of
code also fixed another problem with CMDRET. The following test prog
always failed prior to v1.0.44.14, when the data exeeced about 145kb,
but only when doing a directory listing. It would not fail if
CommandIn := comspec " type someBIGfile.txt" was used.
But with the "fix", this is now rock stable (and repeatable).

Code:
#SingleInstance, force
#Include cmdret_ahk_108_fixed.ahk
SetWorkingDir %A_ScriptDir%
fname = testdata.txt
dirselect := """c:\Program Files"""

CommandIn := comspec " /c dir " dirselect " /s" ; always failed
;CommandIn := comspec " /c  type someBIGfile.txt" ; always worked

testdata := CMDret_RunReturn(CommandIn)
filedelete, %fname%
fileappend, %testdata%, %fname%
MsgBox, Test Complete
exitapp


Chris wrote:
This might be the same issue reported previously at http://www.autohotkey.com/forum/viewtopic.php?t=13468
(hopefully the solution mentioned there will work in this case).

Please let me know if that's insufficient or if it appears to be a bug in AutoHotkey rather than the script. Also, if anyone can point out the exact modification to make to the script, let me know and I'll update it (I don't think Corrupt would mind).

Thanks.
Back to top
jordis



Joined: 30 Jul 2004
Posts: 78

PostPosted: Thu Nov 02, 2006 1:40 pm    Post subject: Re: Last version 1.0.44.14 breaks CMDRet function Reply with quote

rogerg (not logged in) wrote:
I can verify that v1.0.44.14 did indeed break CMDRET, but with the
addition of the line VarSetCapacity(CMDout, -1) after line 80
in file cmdret_ahk_108.ahk, the breakage was repaired.
Great! your fix works perfectly, thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group