auriamg / macdylibbundler

Utility to ease bundling libraries into executables for OSX
MIT License
546 stars 83 forks source link

Fix identified. Missing "/" on path concatenation. #77

Open WallyZambotti opened 2 years ago

WallyZambotti commented 2 years ago

In Dependency.cpp at around line 130:

    //check if file is contained in one of the paths
    for( int i=0; i<searchPathAmount; ++i)
    {
        std::string search_path = Settings::searchPath(i);
        if (search_path[ search_path.size()-1 ] != '/') search_path += "/";  // Add this line to fix missing "/" from path in next line
        if (fileExists( search_path+filename ))
        {
            std::cout << "FOUND " << filename << " in " << search_path << std::endl;
            prefix = search_path;
            missing_prefixes = true; //the prefix was missing
            break;
        }
    }
SCG82 commented 2 years ago

How did you end up with search_path without a trailing slash? If I'm not mistaken, every path added to Settings::searchPath is checked for a missing trailing slash prior to the Settings::addSearchPath(path) call.

WallyZambotti commented 2 years ago

I stepped through the code and noticed there was no trailing "/" slash. So I added the fix and everything started working!!!

"/usr/local/lib"

Definitely no trailing slash when viewed in xCode debugger.

SCG82 commented 2 years ago

Can you create a Pull Request for this?

On Mar 6, 2022, at 9:05 PM, Walter ZAMBOTTI @.***> wrote:

 I stepped through the code and noticed there was no trailing "/" slash. So I added the fix and everything started working!!!

"/usr/local/lib"

Definitely no trailing slash when viewed in xCode debugger.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.