Skip to content

Commit

Permalink
Merge pull request arduino#1773 from oni303/minus_support
Browse files Browse the repository at this point in the history
added support for '-' in filenames
  • Loading branch information
cmaglie committed Mar 4, 2014
2 parents 2380a8f + efedfa7 commit 4c8199e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/src/processing/app/Sketch.java
Original file line number Diff line number Diff line change
Expand Up @@ -2063,9 +2063,10 @@ static public String sanitizeName(String origName) {
for (int i = 0; i < c.length; i++) {
if (((c[i] >= '0') && (c[i] <= '9')) ||
((c[i] >= 'a') && (c[i] <= 'z')) ||
((c[i] >= 'A') && (c[i] <= 'Z'))) {
((c[i] >= 'A') && (c[i] <= 'Z')) ||
((i > 0) && (c[i] == '-')) ||
((i > 0) && (c[i] == '.'))) {
buffer.append(c[i]);

} else {
buffer.append('_');
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/processing/app/SketchCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public SketchCode(File file, String extension) {

protected void makePrettyName() {
prettyName = file.getName();
int dot = prettyName.indexOf('.');
int dot = prettyName.lastIndexOf('.');
prettyName = prettyName.substring(0, dot);
}

Expand Down

0 comments on commit 4c8199e

Please sign in to comment.