zephyr/subsys/fs/fs_impl.c
Gerard Marull-Paretas 5113c1418d subsystems: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all subsystems code to
the new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:07:35 +02:00

23 lines
415 B
C

/*
* Copyright (c) 2019 Peter Bigot Consulting, LLC
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/zephyr.h>
#include <zephyr/fs/fs.h>
#include "fs_impl.h"
const char *fs_impl_strip_prefix(const char *path,
const struct fs_mount_t *mp)
{
static const char *const root = "/";
if ((path == NULL) || (mp == NULL)) {
return path;
}
path += mp->mountp_len;
return *path ? path : root;
}