1 /*
2  * Copyright (c) 2019 Peter Bigot Consulting, LLC
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/kernel.h>
8 #include <zephyr/fs/fs.h>
9 #include "fs_impl.h"
10 
fs_impl_strip_prefix(const char * path,const struct fs_mount_t * mp)11 const char *fs_impl_strip_prefix(const char *path,
12 				 const struct fs_mount_t *mp)
13 {
14 	static const char *const root = "/";
15 
16 	if ((path == NULL) || (mp == NULL)) {
17 		return path;
18 	}
19 
20 	path += mp->mountp_len;
21 	return *path ? path : root;
22 }
23