diff options
Diffstat (limited to 'firmware/common')
-rw-r--r-- | firmware/common/pathfuncs.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/firmware/common/pathfuncs.c b/firmware/common/pathfuncs.c index 1ee5fe9886..f5674983d9 100644 --- a/firmware/common/pathfuncs.c +++ b/firmware/common/pathfuncs.c | |||
@@ -197,35 +197,6 @@ int path_strip_drive(const char *name, const char **nameptr, bool greedy) | |||
197 | return -1; | 197 | return -1; |
198 | } | 198 | } |
199 | 199 | ||
200 | /* Strips leading and trailing whitespace from a path | ||
201 | * " a/b \txyz" *nameptr->a, len=3: "a/b" | ||
202 | */ | ||
203 | size_t path_trim_whitespace(const char *name, const char **nameptr) | ||
204 | { | ||
205 | /* NOTE: this won't currently treat DEL (0x7f) as non-printable */ | ||
206 | const unsigned char *p = name; | ||
207 | int c; | ||
208 | |||
209 | while ((c = *p) <= ' ' && c) | ||
210 | ++p; | ||
211 | |||
212 | const unsigned char *first = p; | ||
213 | const unsigned char *last = p; | ||
214 | |||
215 | while (1) | ||
216 | { | ||
217 | if (c < ' ') | ||
218 | { | ||
219 | *nameptr = first; | ||
220 | return last - first; | ||
221 | } | ||
222 | |||
223 | while ((c = *++p) > ' '); | ||
224 | last = p; | ||
225 | while (c == ' ') c = *++p; | ||
226 | } | ||
227 | } | ||
228 | |||
229 | /* Strips directory components from the path | 200 | /* Strips directory components from the path |
230 | * "" *nameptr->NUL, len=0: "" | 201 | * "" *nameptr->NUL, len=0: "" |
231 | * "/" *nameptr->/, len=1: "/" | 202 | * "/" *nameptr->/, len=1: "/" |