Skip to content

Commit

Permalink
Move the declaration of rb_path_check
Browse files Browse the repository at this point in the history
Although this function is unrelated to hash, it was defined in hash.c
to check PATH environment variable originally.  Then the definition
was moeved to file.c but the declaration was left in the hash.c block.
  • Loading branch information
nobu committed Jan 13, 2025
1 parent 384e694 commit f7fd42c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
13 changes: 13 additions & 0 deletions include/ruby/internal/intern/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,19 @@ int rb_is_absolute_path(const char *path);
*/
rb_off_t rb_file_size(VALUE file);

/**
* If the PATH_SEPARATOR-separated list of directory names contains the name of
* a world-writable directory, issue a warning for it. This may do nothing on
* some platforms.
*
* @param[in] path A local path.
* @retval 0 The "check" succeeded.
* @retval otherwise The "check" failed.
* @note This feature may be disabled by setting `ENABLE_PATH_CHECK`
* macro to zero at compilation time.
*/
int rb_path_check(const char *path);

RBIMPL_SYMBOL_EXPORT_END()

#endif /* RBIMPL_INTERN_FILE_H */
17 changes: 0 additions & 17 deletions include/ruby/internal/intern/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,23 +284,6 @@ typedef VALUE rb_hash_update_func(VALUE newkey, VALUE oldkey, VALUE value);
*/
VALUE rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func);

/* file.c */

/**
* If the PATH_SEPARATOR-separated list of directory names contains the name of
* a world-writable directory, issue a warning for it. This may do nothing on
* some platforms.
*
* @param[in] path A local path.
* @retval 0 The "check" succeeded.
* @retval otherwise The "check" failed.
* @note This feature may be disabled by setting `ENABLE_PATH_CHECK`
* macro to zero at compilation time.
*/
int rb_path_check(const char *path);

/* hash.c */

/**
* Destructively removes every environment variables of the running process.
*
Expand Down

0 comments on commit f7fd42c

Please sign in to comment.