forked from Imagelibrary/rtems
Filesystem: Export most generic path eval function
Add path length parameter to rtems_filesystem_eval_path_start_with_root_and_current() so that users may pass paths without a '\0' termination. Update #2558.
This commit is contained in:
@@ -328,6 +328,7 @@ rtems_filesystem_location_info_t *
|
|||||||
rtems_filesystem_eval_path_start_with_root_and_current(
|
rtems_filesystem_eval_path_start_with_root_and_current(
|
||||||
rtems_filesystem_eval_path_context_t *ctx,
|
rtems_filesystem_eval_path_context_t *ctx,
|
||||||
const char *path,
|
const char *path,
|
||||||
|
size_t pathlen,
|
||||||
int eval_flags,
|
int eval_flags,
|
||||||
rtems_filesystem_global_location_t *const *global_root_ptr,
|
rtems_filesystem_global_location_t *const *global_root_ptr,
|
||||||
rtems_filesystem_global_location_t *const *global_current_ptr
|
rtems_filesystem_global_location_t *const *global_current_ptr
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ int chroot( const char *path )
|
|||||||
rtems_filesystem_eval_path_start_with_root_and_current(
|
rtems_filesystem_eval_path_start_with_root_and_current(
|
||||||
&ctx,
|
&ctx,
|
||||||
path,
|
path,
|
||||||
|
strlen( path ),
|
||||||
eval_flags,
|
eval_flags,
|
||||||
&rtems_global_user_env.root_directory,
|
&rtems_global_user_env.root_directory,
|
||||||
&rtems_global_user_env.current_directory
|
&rtems_global_user_env.current_directory
|
||||||
|
|||||||
@@ -136,8 +136,8 @@ void rtems_filesystem_eval_path_continue(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_filesystem_location_info_t *
|
rtems_filesystem_location_info_t *
|
||||||
eval_path_start(
|
rtems_filesystem_eval_path_start_with_root_and_current(
|
||||||
rtems_filesystem_eval_path_context_t *ctx,
|
rtems_filesystem_eval_path_context_t *ctx,
|
||||||
const char *path,
|
const char *path,
|
||||||
size_t pathlen,
|
size_t pathlen,
|
||||||
@@ -166,25 +166,6 @@ eval_path_start(
|
|||||||
return &ctx->currentloc;
|
return &ctx->currentloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtems_filesystem_location_info_t *
|
|
||||||
rtems_filesystem_eval_path_start_with_root_and_current(
|
|
||||||
rtems_filesystem_eval_path_context_t *ctx,
|
|
||||||
const char *path,
|
|
||||||
int eval_flags,
|
|
||||||
rtems_filesystem_global_location_t *const *global_root_ptr,
|
|
||||||
rtems_filesystem_global_location_t *const *global_current_ptr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return eval_path_start(
|
|
||||||
ctx,
|
|
||||||
path,
|
|
||||||
strlen(path),
|
|
||||||
eval_flags,
|
|
||||||
global_root_ptr,
|
|
||||||
global_current_ptr
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
rtems_filesystem_location_info_t *
|
rtems_filesystem_location_info_t *
|
||||||
rtems_filesystem_eval_path_start(
|
rtems_filesystem_eval_path_start(
|
||||||
rtems_filesystem_eval_path_context_t *ctx,
|
rtems_filesystem_eval_path_context_t *ctx,
|
||||||
@@ -195,6 +176,7 @@ rtems_filesystem_eval_path_start(
|
|||||||
return rtems_filesystem_eval_path_start_with_root_and_current(
|
return rtems_filesystem_eval_path_start_with_root_and_current(
|
||||||
ctx,
|
ctx,
|
||||||
path,
|
path,
|
||||||
|
strlen(path),
|
||||||
eval_flags,
|
eval_flags,
|
||||||
&rtems_filesystem_root,
|
&rtems_filesystem_root,
|
||||||
&rtems_filesystem_current
|
&rtems_filesystem_current
|
||||||
@@ -229,7 +211,7 @@ rtems_filesystem_eval_path_start_with_parent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
currentloc = eval_path_start(
|
currentloc = rtems_filesystem_eval_path_start_with_root_and_current(
|
||||||
ctx,
|
ctx,
|
||||||
parentpath,
|
parentpath,
|
||||||
parentpathlen,
|
parentpathlen,
|
||||||
|
|||||||
Reference in New Issue
Block a user