Mg LibMaker bug, also in Carl Barnes LibMakerPlus

Tags: #<Tag:0x00007fc0ddbb06c0> #<Tag:0x00007fc0ddbb0558>

In the program code() - FileAdded routine of the MgLibMakerMinus by Carl Barnes 2020.9.6 this is the code:
IF INSTRING(’.LIB’, UPPER(FileName), 1, 1)
ReadLib()
ELSE
ReadExecutable()
END
This is a problem if the file we are processing is a DLL, but somewhere in the whole path to a file there’s a “LIB” word, like this: C:\test\test.libs\project1\test.dll
The above code treats test.dll as a LIB because of the path, but it should as executable.
I’ve modified the code to:
IF RIGHT(UPPER(FILENAME),4)=’.LIB’
ReadLib()
ELSE
ReadExecutable()
END

So now it processes only files with extension LIB as LIBs. The rest are executables.

2 Likes

Thank you! I have updated GitHub with your change. That same code appears in 2 places.

I also found this similar code that could have similar problems:

lcl.CurrModule = WriteExpQ.module
lcl.instringLoc     = instring('.DLL',upper(lcl.CurrModule),1,1)
if ~lcl.instringLoc
    lcl.instringLoc = instring('.EXE',upper(lcl.CurrModule),1,1)
end
if lcl.instringLoc
   lcl.CurrModule[lcl.instringLoc + 1 : lcl.instringLoc + 3] = 'lib'
end

I changed it to the below code:

lcl.CurrModule = WriteExpQ.module
lcl.LenModName = len(clip(lcl.CurrModule))   !01/02/22 revised as Instring is wrong incase name is xxxx.dll.lib
case upper(sub(lcl.CurrModule, lcl.LenModName-3, 4))
of   '.DLL' 
orof '.EXE'
            lcl.CurrModule[lcl.LenModName - 3 : lcl.LenModName] = '.lib'
end

The Repo for my LibMaker is

1 Like

@MarkGoldberg you may want to check this out

My LibMakerPlus is based on Mark’s MgLibMaker and his code on GitHub does show the same bugs.

Mark worked with me on my version that I used for a CIDC presentation. It does have many new features like search, tagging, WinSxS. The GitHub ReadMe has details.

It has a unique “Subtract” a feature to see differences, e.g. load the 11.1 ClaRun.DLL then Subtract the 11.0 ClaRun.DLL and only what’s new remains. If you load a Windows DLL you can subtract the Clarion Win32.LIB so you have just wat SV has not defined and no duplicate errors.