[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-5-2+backports' - solenv/gcc-wrappers
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Jan 18 15:06:57 UTC 2019
solenv/gcc-wrappers/wrapper.cxx | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
New commits:
commit 72d6ad419c6c4c7b1877e31996cfd672b4a25d1e
Author: Mark Hung <marklh9 at gmail.com>
AuthorDate: Thu Feb 23 07:48:02 2017 +0800
Commit: Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Jan 18 16:05:28 2019 +0100
solenv(gcc-wrappers): remove trailing space of includepath
Change-Id: Ic14140f197a2c5e1632fd27cfae38ca4eff9bd8c
Reviewed-on: https://gerrit.libreoffice.org/34562
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
(cherry picked from commit baf043318e83e768abe4ed7ae1c45bb75c0197e3)
diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index cc57698a3aa9..6178831c45c1 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -49,7 +49,7 @@ void setupccenv() {
}
// Set-up include path
- string includepath="INCLUDE=.;";
+ string includepath="INCLUDE=.";
char* incbuf;
size_t inclen;
_dupenv_s(&incbuf,&inclen,"SOLARINC");
@@ -61,16 +61,20 @@ void setupccenv() {
free(incbuf);
// 3 = strlen(" -I")
- for(size_t pos=0; pos != string::npos;) {
- size_t endpos=inctmp.find(" -I",pos+3);
- size_t len=endpos-pos-3;
+ for(size_t pos=0,len=0;pos<inctmp.length();) {
+ size_t endpos=inctmp.find(" -I",pos+1);
if(endpos==string::npos)
- includepath.append(inctmp,pos+3,endpos);
- else if(len>0) {
- includepath.append(inctmp,pos+3,len);
+ endpos=inctmp.length();
+ len=endpos-pos;
+
+ while(len>0&&inctmp[pos+len-1]==' ')
+ --len;
+
+ if(len>3) {
includepath.append(";");
+ includepath.append(inctmp,pos+3,len-3);
}
- pos=inctmp.find(" -I",pos+len);
+ pos=endpos;
}
if(_putenv(includepath.c_str())<0) {
cerr << "Error: could not export INCLUDE" << endl;
More information about the Libreoffice-commits
mailing list