|
@@ -584,22 +584,15 @@ void CardReader::chdir(const char * relpath) {
|
584
|
584
|
SERIAL_ECHOLN(relpath);
|
585
|
585
|
}
|
586
|
586
|
else {
|
587
|
|
- if (workDirDepth < MAX_DIR_DEPTH) {
|
588
|
|
- ++workDirDepth;
|
589
|
|
- for (int d = workDirDepth; d--;) workDirParents[d + 1] = workDirParents[d];
|
590
|
|
- workDirParents[0] = *parent;
|
591
|
|
- }
|
|
587
|
+ if (workDirDepth < MAX_DIR_DEPTH)
|
|
588
|
+ workDirParents[workDirDepth++] = *parent;
|
592
|
589
|
workDir = newfile;
|
593
|
590
|
}
|
594
|
591
|
}
|
595
|
592
|
|
596
|
593
|
void CardReader::updir() {
|
597
|
|
- if (workDirDepth > 0) {
|
598
|
|
- --workDirDepth;
|
599
|
|
- workDir = workDirParents[0];
|
600
|
|
- for (uint16_t d = 0; d < workDirDepth; d++)
|
601
|
|
- workDirParents[d] = workDirParents[d+1];
|
602
|
|
- }
|
|
594
|
+ if (workDirDepth > 0)
|
|
595
|
+ workDir = workDirParents[--workDirDepth];
|
603
|
596
|
}
|
604
|
597
|
|
605
|
598
|
void CardReader::printingHasFinished() {
|