Skip to content

Commit

Permalink
CMFileManager: Escape $ on prepared arguments
Browse files Browse the repository at this point in the history
Escape $ character when passing arguments to shell. xe: create new file with  name "$My Documents"

Change-Id: I939d830beaa4c372aa679f3d27f7c691a29c421e
  • Loading branch information
jruesga committed Nov 22, 2012
1 parent 088a679 commit 4ab0701
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/com/cyanogenmod/filemanager/util/ShellHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public static String prepareArgument(final String arg) {
if (arg == null) {
return null;
}
return arg.replace("\"", "\\\""); //$NON-NLS-1$//$NON-NLS-2$
String preparedArgs = arg.replace("\"", "\\\""); //$NON-NLS-1$//$NON-NLS-2$
preparedArgs = preparedArgs.replace("$", "\\$"); //$NON-NLS-1$//$NON-NLS-2$
return preparedArgs;
}

/**
Expand Down

0 comments on commit 4ab0701

Please sign in to comment.