Skip to content

Commit f7fd42c

Browse files
committed
Move the declaration of rb_path_check
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.
1 parent 384e694 commit f7fd42c

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

include/ruby/internal/intern/file.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,19 @@ int rb_is_absolute_path(const char *path);
208208
*/
209209
rb_off_t rb_file_size(VALUE file);
210210

211+
/**
212+
* If the PATH_SEPARATOR-separated list of directory names contains the name of
213+
* a world-writable directory, issue a warning for it. This may do nothing on
214+
* some platforms.
215+
*
216+
* @param[in] path A local path.
217+
* @retval 0 The "check" succeeded.
218+
* @retval otherwise The "check" failed.
219+
* @note This feature may be disabled by setting `ENABLE_PATH_CHECK`
220+
* macro to zero at compilation time.
221+
*/
222+
int rb_path_check(const char *path);
223+
211224
RBIMPL_SYMBOL_EXPORT_END()
212225

213226
#endif /* RBIMPL_INTERN_FILE_H */

include/ruby/internal/intern/hash.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -284,23 +284,6 @@ typedef VALUE rb_hash_update_func(VALUE newkey, VALUE oldkey, VALUE value);
284284
*/
285285
VALUE rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func);
286286

287-
/* file.c */
288-
289-
/**
290-
* If the PATH_SEPARATOR-separated list of directory names contains the name of
291-
* a world-writable directory, issue a warning for it. This may do nothing on
292-
* some platforms.
293-
*
294-
* @param[in] path A local path.
295-
* @retval 0 The "check" succeeded.
296-
* @retval otherwise The "check" failed.
297-
* @note This feature may be disabled by setting `ENABLE_PATH_CHECK`
298-
* macro to zero at compilation time.
299-
*/
300-
int rb_path_check(const char *path);
301-
302-
/* hash.c */
303-
304287
/**
305288
* Destructively removes every environment variables of the running process.
306289
*

0 commit comments

Comments
 (0)