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:
commit
4c8199e412
@ -2063,9 +2063,10 @@ public class Sketch {
|
|||||||
for (int i = 0; i < c.length; i++) {
|
for (int i = 0; i < c.length; i++) {
|
||||||
if (((c[i] >= '0') && (c[i] <= '9')) ||
|
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'))) {
|
((c[i] >= 'A') && (c[i] <= 'Z')) ||
|
||||||
|
((i > 0) && (c[i] == '-')) ||
|
||||||
|
((i > 0) && (c[i] == '.'))) {
|
||||||
buffer.append(c[i]);
|
buffer.append(c[i]);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
buffer.append('_');
|
buffer.append('_');
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ public class SketchCode {
|
|||||||
|
|
||||||
protected void makePrettyName() {
|
protected void makePrettyName() {
|
||||||
prettyName = file.getName();
|
prettyName = file.getName();
|
||||||
int dot = prettyName.indexOf('.');
|
int dot = prettyName.lastIndexOf('.');
|
||||||
prettyName = prettyName.substring(0, dot);
|
prettyName = prettyName.substring(0, dot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user