1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Merge pull request #1773 from oni303/minus_support

added support for '-' in filenames
This commit is contained in:
Cristian Maglie 2014-03-04 10:55:00 +01:00
commit 4c8199e412
2 changed files with 4 additions and 3 deletions

View File

@ -2063,9 +2063,10 @@ public class Sketch {
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('_');
}

View File

@ -87,7 +87,7 @@ public class SketchCode {
protected void makePrettyName() {
prettyName = file.getName();
int dot = prettyName.indexOf('.');
int dot = prettyName.lastIndexOf('.');
prettyName = prettyName.substring(0, dot);
}