1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 04:55:22 +02:00

[246710] Fix quoting backslashes in UNIX shells

This commit is contained in:
Martin Oberhuber 2008-09-09 15:24:18 +00:00
parent bd849bd10b
commit 16cae877e8

View file

@ -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
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* 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) - 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) - [246710] Fix quoting backslashes in UNIX shells
********************************************************************************/
package org.eclipse.rse.services.clientserver;
@ -224,15 +225,15 @@ public class PathUtility
char c=s.charAt(i);
switch(c) {
case '$':
case '\\':
//Need to treat specially to work in both bash and tcsh:
//close the quote, insert quoted $, reopen the quote
buf.append('"');
buf.append('\\');
buf.append('$');
buf.append(c);
buf.append('"');
break;
case '"':
case '\\':
case '\'':
case '`':
case '\n':