mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 13:05:22 +02:00
[246710] Fix quoting backslashes in UNIX shells
This commit is contained in:
parent
bd849bd10b
commit
16cae877e8
1 changed files with 30 additions and 29 deletions
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
@ -16,6 +16,7 @@
|
||||||
* Martin Oberhuber (Wind River) - Use pre-compiled regex Pattern
|
* Martin Oberhuber (Wind River) - Use pre-compiled regex Pattern
|
||||||
* Martin Oberhuber (Wind River) - Fix 154874 - handle files with space or $ in the name
|
* Martin Oberhuber (Wind River) - Fix 154874 - handle files with space or $ in the name
|
||||||
* Martin Oberhuber (Wind River) - Fix 183991 - handle windows C:/ paths for FTP
|
* Martin Oberhuber (Wind River) - Fix 183991 - handle windows C:/ paths for FTP
|
||||||
|
* Martin Oberhuber (Wind River) - [246710] Fix quoting backslashes in UNIX shells
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.services.clientserver;
|
package org.eclipse.rse.services.clientserver;
|
||||||
|
@ -224,15 +225,15 @@ public class PathUtility
|
||||||
char c=s.charAt(i);
|
char c=s.charAt(i);
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case '$':
|
case '$':
|
||||||
|
case '\\':
|
||||||
//Need to treat specially to work in both bash and tcsh:
|
//Need to treat specially to work in both bash and tcsh:
|
||||||
//close the quote, insert quoted $, reopen the quote
|
//close the quote, insert quoted $, reopen the quote
|
||||||
buf.append('"');
|
buf.append('"');
|
||||||
buf.append('\\');
|
buf.append('\\');
|
||||||
buf.append('$');
|
buf.append(c);
|
||||||
buf.append('"');
|
buf.append('"');
|
||||||
break;
|
break;
|
||||||
case '"':
|
case '"':
|
||||||
case '\\':
|
|
||||||
case '\'':
|
case '\'':
|
||||||
case '`':
|
case '`':
|
||||||
case '\n':
|
case '\n':
|
||||||
|
|
Loading…
Add table
Reference in a new issue