summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2018-11-30 14:40:01 -0800
committerScott Shawcroft <scott@tannewt.org>2018-11-30 14:40:01 -0800
commit95e03092630bbad9949c5fe32cd51e7c29bc065b (patch)
tree484cb7535142eaabe873bc10552bbfa1b48ab43b /lib
parent754d6afd163ae5f295444166863b5d11afd1b2e4 (diff)
parentab94344baee1a5d73d3890de16319cab1e2616de (diff)
Merge remote-tracking branch 'adafruit/master' into mini_sam
Diffstat (limited to 'lib')
-rw-r--r--lib/oofatfs/ff.c2
m---------lib/tinyusb0
-rw-r--r--lib/utils/stdout_helpers.c16
3 files changed, 14 insertions, 4 deletions
diff --git a/lib/oofatfs/ff.c b/lib/oofatfs/ff.c
index 4e8680545..b0984756b 100644
--- a/lib/oofatfs/ff.c
+++ b/lib/oofatfs/ff.c
@@ -2579,8 +2579,8 @@ FRESULT create_name ( /* FR_OK: successful, FR_INVALID_NAME: could not create
if (w < 0x80 && chk_chr("\"*:<>\?|\x7F", w)) return FR_INVALID_NAME; /* Reject illegal characters for LFN */
lfn[di++] = w; /* Store the Unicode character */
}
- cf = ((w < ' ') || ((w == '/' || w == '\\') && p[si+1] < ' ')) ? NS_LAST : 0; /* Set last segment flag if end of the path */
*path = &p[si]; /* Return pointer to the next segment */
+ cf = (w < ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */
#if _FS_RPATH != 0
if ((di == 1 && lfn[di - 1] == '.') ||
(di == 2 && lfn[di - 1] == '.' && lfn[di - 2] == '.')) { /* Is this segment a dot name? */
diff --git a/lib/tinyusb b/lib/tinyusb
-Subproject 583326e535454f16b06ebdb9cc06869602a5564
+Subproject 47fabe42edaae4a5da6aa0d48c664a918457875
diff --git a/lib/utils/stdout_helpers.c b/lib/utils/stdout_helpers.c
index 3de119757..4323e8a08 100644
--- a/lib/utils/stdout_helpers.c
+++ b/lib/utils/stdout_helpers.c
@@ -12,11 +12,21 @@
// Send "cooked" string of given length, where every occurrence of
// LF character is replaced with CR LF.
void mp_hal_stdout_tx_strn_cooked(const char *str, size_t len) {
- while (len--) {
- if (*str == '\n') {
+ bool last_cr = false;
+ while (len > 0) {
+ size_t i = 0;
+ if (str[0] == '\n' && !last_cr) {
mp_hal_stdout_tx_strn("\r", 1);
+ i = 1;
}
- mp_hal_stdout_tx_strn(str++, 1);
+ // Lump all characters on the next line together.
+ while((last_cr || str[i] != '\n') && i < len) {
+ last_cr = str[i] == '\r';
+ i++;
+ }
+ mp_hal_stdout_tx_strn(str, i);
+ str = &str[i];
+ len -= i;
}
}