summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/common/pathfuncs.c29
-rw-r--r--firmware/export/pathfuncs.h1
2 files changed, 0 insertions, 30 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 */
203size_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: "/"
diff --git a/firmware/export/pathfuncs.h b/firmware/export/pathfuncs.h
index 26eb4a1067..92539c54c1 100644
--- a/firmware/export/pathfuncs.h
+++ b/firmware/export/pathfuncs.h
@@ -78,7 +78,6 @@ int get_volume_name(int volume, char *name);
78#endif 78#endif
79 79
80int path_strip_drive(const char *name, const char **nameptr, bool greedy); 80int path_strip_drive(const char *name, const char **nameptr, bool greedy);
81size_t path_trim_whitespace(const char *name, const char **nameptr);
82size_t path_basename(const char *name, const char **nameptr); 81size_t path_basename(const char *name, const char **nameptr);
83size_t path_dirname(const char *name, const char **nameptr); 82size_t path_dirname(const char *name, const char **nameptr);
84size_t path_strip_trailing_separators(const char *name, const char **nameptr); 83size_t path_strip_trailing_separators(const char *name, const char **nameptr);