Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2008-05-01 13:27:06 -0400
committerAndrew Niefer2008-05-01 13:27:06 -0400
commita8c3100faa8b5f31e0ab0913319e1df4d8b96bca (patch)
tree8418c434c790d833d3fa439ca627d32ebe1496fd /bundles
parent0e1bb97accd58b2248b17a217bc1a48a426e9911 (diff)
downloadrt.equinox.framework-a8c3100faa8b5f31e0ab0913319e1df4d8b96bca.tar.gz
rt.equinox.framework-a8c3100faa8b5f31e0ab0913319e1df4d8b96bca.tar.xz
rt.equinox.framework-a8c3100faa8b5f31e0ab0913319e1df4d8b96bca.zip
bug 222107 - escaped "v20080501
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.executable/.cproject3
-rw-r--r--bundles/org.eclipse.equinox.executable/library/make_version.mak2
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c16
-rw-r--r--bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp16
4 files changed, 27 insertions, 10 deletions
diff --git a/bundles/org.eclipse.equinox.executable/.cproject b/bundles/org.eclipse.equinox.executable/.cproject
index 144270972..da39082d5 100644
--- a/bundles/org.eclipse.equinox.executable/.cproject
+++ b/bundles/org.eclipse.equinox.executable/.cproject
@@ -82,7 +82,7 @@
</target>
<target name="all-mingw" path="library/win32" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
-<buildArguments>-f make_mingw.mak JAVA_HOME=C:/Dev/Java/IBM_1.5.0</buildArguments>
+<buildArguments>-f make_mingw.mak JAVA_HOME=C:/Dev/Java/IBM-1.5.0</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
@@ -124,6 +124,7 @@
</target>
</buildTargets>
</storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
</cproject>
diff --git a/bundles/org.eclipse.equinox.executable/library/make_version.mak b/bundles/org.eclipse.equinox.executable/library/make_version.mak
index 201611336..3662bd902 100644
--- a/bundles/org.eclipse.equinox.executable/library/make_version.mak
+++ b/bundles/org.eclipse.equinox.executable/library/make_version.mak
@@ -10,5 +10,5 @@
#*******************************************************************************
maj_ver=1
-min_ver=113
+min_ver=113b
LIB_VERSION = $(maj_ver)$(min_ver)
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c
index 7edada558..52b36b503 100644
--- a/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c
+++ b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c
@@ -312,7 +312,7 @@ static _TCHAR* checkVMRegistryKey(HKEY jreKey, _TCHAR* subKeyName) {
static _TCHAR* buildCommandLine( _TCHAR* program, _TCHAR* args[] )
{
- int index;
+ int index, slash;
size_t length = 0;
_TCHAR *commandLine, *ch, *space;
@@ -326,8 +326,8 @@ static _TCHAR* buildCommandLine( _TCHAR* program, _TCHAR* args[] )
{
/* String length plus space character */
length += _tcslen( args[ index ] ) + 1;
- /* Quotes */
- if (_tcschr( args[ index ], _T(' ') ) != NULL) length += 2;
+ /* Quotes + potential escaping '\' */
+ if (_tcschr( args[ index ], _T(' ') ) != NULL) length += 3;
}
commandLine = ch = malloc ( (length + 1) * sizeof(_TCHAR) );
@@ -342,7 +342,15 @@ static _TCHAR* buildCommandLine( _TCHAR* program, _TCHAR* args[] )
if (space != NULL) *ch++ = _T('\"');
_tcscpy( ch, args[index] );
ch += _tcslen( args[index] );
- if (space != NULL) *ch++ = _T('\"');
+ if (space != NULL) {
+ if ( *(ch - 1) == _T('\\') ) {
+ /* escape a trailing unescaped '\' or it will escape our closing '"' and mess things up */
+ slash = 1;
+ while ( *(ch - 1 - slash) == _T('\\')) slash++;
+ if (slash % 2) *ch++ = _T('\\');
+ }
+ *ch++ = _T('\"');
+ }
*ch++ = _T(' ');
}
*ch = _T('\0');
diff --git a/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp b/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp
index f20c0ef61..6dfee896d 100644
--- a/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp
+++ b/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp
@@ -371,7 +371,7 @@ static _TCHAR* checkVMRegistryKey(HKEY jreKey, _TCHAR* subKeyName) {
static _TCHAR* buildCommandLine( _TCHAR* program, _TCHAR* args[] )
{
- int index, length = 0;
+ int index, length = 0, slash;
_TCHAR *commandLine, *ch, *space;
/*
@@ -384,8 +384,8 @@ static _TCHAR* buildCommandLine( _TCHAR* program, _TCHAR* args[] )
{
/* String length plus space character */
length += _tcslen( args[ index ] ) + 1;
- /* Quotes */
- if (_tcschr( args[ index ], _T(' ') ) != NULL) length += 2;
+ /* Quotes + potential escaping '\' */
+ if (_tcschr( args[ index ], _T(' ') ) != NULL) length += 3;
}
commandLine = ch = (_TCHAR *)malloc ( (length + 1) * sizeof(_TCHAR) );
@@ -400,7 +400,15 @@ static _TCHAR* buildCommandLine( _TCHAR* program, _TCHAR* args[] )
if (space != NULL) *ch++ = _T('\"');
_tcscpy( ch, args[index] );
ch += _tcslen( args[index] );
- if (space != NULL) *ch++ = _T('\"');
+ if (space != NULL) {
+ if ( *(ch - 1) == _T('\\') ) {
+ /* escape a trailing unescaped '\' or it will escape our closing '"' and mess things up */
+ slash = 1;
+ while ( *(ch - 1 - slash) == _T('\\')) slash++;
+ if (slash % 2) *ch++ = _T('\\');
+ }
+ *ch++ = _T('\"');
+ }
*ch++ = _T(' ');
}
*ch = _T('\0');

Back to the top