U++ framework
Do not panic. Ask here before giving up.

Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » [Bug+Patch] when there is a space in Upp path (gdb does not find exefile, && problem using windres)
Re: [Bug+Patch] when there is a space in Upp path [message #47776 is a reply to message #47770] Fri, 24 March 2017 23:46 Go to previous messageGo to previous message
omari is currently offline  omari
Messages: 276
Registered: March 2010
Experienced Member
Hi,

in the proposed patch:
GetHostPathShort( FindInDirs(((LocalHost*)host)->exedirs, "windres.exe"))

the cast (LocalHost*)host, does not work properly.
i have tested with
LocalHost*h = dynamic_cast<LocalHost*>(host)

host is not NULL, but after the execution of this line, h is equal to NULL !

to avoid this, we can extract the PATH from Host.GetEnvironnement() instead of Localhost.exedirs

here the new patch :
			if(rc) {

 				String windres = "windres";
				String env = host->GetEnvironment();
				const char* path = (const char*) env.begin();
				while(*path)
				{
					if(path[0] == 'P' && path[1] == 'A' && path[2] == 'T' && path[3] == 'H' && path[4] == '=')
					{
						path+=5;
						Vector<String> dirs = Split(path, ";") ;
						String fullpath = FindInDirs(dirs, "windres.exe");
						windres = GetHostPathShort( fullpath);
						break;
					}
					
					while(*path)++path;
					++path;
				}
				
				String exec;
				exec << windres << " -i " << GetHostPathQ(fn);
				....
 


regards
omari.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Files save issue
Next Topic: MySql and upp 2017r1
Goto Forum:
  


Current Time: Wed Jun 24 01:31:49 GMT+2 2026

Total time taken to generate the page: 0.00673 seconds