diff options
author | Alain Magloire | 2003-01-23 20:58:31 +0000 |
---|---|---|
committer | Alain Magloire | 2003-01-23 20:58:31 +0000 |
commit | f0c97590fa3454826536efa43411585277c0d7fe (patch) | |
tree | 1368c6b1d4000f4ae3bbec70727925241a9def95 /core/org.eclipse.cdt.core.win32/library/starter | |
parent | 7420278c4ccbf006706b4d47f0cb8074cc5cd1d9 (diff) | |
download | org.eclipse.cdt-f0c97590fa3454826536efa43411585277c0d7fe.tar.gz org.eclipse.cdt-f0c97590fa3454826536efa43411585277c0d7fe.tar.xz org.eclipse.cdt-f0c97590fa3454826536efa43411585277c0d7fe.zip |
Correct escaped quotations.
Diffstat (limited to 'core/org.eclipse.cdt.core.win32/library/starter')
-rw-r--r-- | core/org.eclipse.cdt.core.win32/library/starter/starter.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core.win32/library/starter/starter.cpp b/core/org.eclipse.cdt.core.win32/library/starter/starter.cpp index 16ba487acc9..5224412a063 100644 --- a/core/org.eclipse.cdt.core.win32/library/starter/starter.cpp +++ b/core/org.eclipse.cdt.core.win32/library/starter/starter.cpp @@ -188,11 +188,10 @@ int copyTo(LPTSTR target, LPCTSTR source, int cpyLength, int availSpace) int i = 0, j = 0;
int totCpyLength = cpyLength;
BOOL bQoutedTerm = FALSE;
-
if(availSpace <= cpyLength) // = to reserve space for '\0'
return -1;
- if((_T('\"') == *source) && (_T('\"') == *(source + cpyLength)))
+ if((_T('\"') == *source) && (_T('\"') == *(source + cpyLength - 1)))
bQoutedTerm = TRUE; // Already quoted
else
if(_tcschr(source, _T(' ')) == NULL)
@@ -209,7 +208,8 @@ int copyTo(LPTSTR target, LPCTSTR source, int cpyLength, int availSpace) if(source[i] == _T('\\'))
bSlash = TRUE;
else
- if((source[i] == _T('\"')) && (!bQoutedTerm || (i != 0) || i != (cpyLength)) )
+ // Escape double quote only if quotation mark is not start or end character
+ if((source[i] == _T('\"')) && (!bQoutedTerm || ((i != 0) && (i != (cpyLength - 1)))) )
{
if(!bSlash)
{
@@ -235,7 +235,6 @@ int copyTo(LPTSTR target, LPCTSTR source, int cpyLength, int availSpace) target[j] = _T('\"');
++j;
}
-
return j;
}
|