mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-17 13:15:44 +02:00
[332275] "#" in local file name is changed to "#035" after copy
This commit is contained in:
parent
84c1a81398
commit
d80ff5274a
1 changed files with 12 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2002, 2009 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2002, 2011 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
|
||||||
|
@ -14,12 +14,17 @@
|
||||||
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
||||||
* David Dykstal (IBM) - [226561] Add API markup to RSE javadocs for extend / implement
|
* David Dykstal (IBM) - [226561] Add API markup to RSE javadocs for extend / implement
|
||||||
* David McKnight (IBM) - [276194] cannot open file with '...' in pathname
|
* David McKnight (IBM) - [276194] cannot open file with '...' in pathname
|
||||||
|
* David McKnight (IBM) - [332275] "#" in local file name is changed to "#035" after copy
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.core.model;
|
package org.eclipse.rse.core.model;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
import org.eclipse.core.resources.IResource;
|
||||||
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a utility class used in the construction of file names.
|
* This is a utility class used in the construction of file names.
|
||||||
* @noextend This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
|
@ -53,6 +58,12 @@ public class SystemEscapeCharHelper {
|
||||||
|
|
||||||
public String getStringForFileName(String name)
|
public String getStringForFileName(String name)
|
||||||
{
|
{
|
||||||
|
// first do a validation before escaping
|
||||||
|
IStatus status = ResourcesPlugin.getWorkspace().validatePath(name,IResource.FILE);
|
||||||
|
if (status.getCode() == IStatus.OK){ // if it's valid, don't bother escaping
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
String fileName = name;
|
String fileName = name;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue