util.h: remove my_getcwd

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-11-26 01:36:33 +00:00
parent a55320b093
commit cea5a91163
4 changed files with 6 additions and 7 deletions

2
dir.c
View File

@ -1127,7 +1127,7 @@ rb_dir_getwd_ospath(void)
#undef RUBY_UNTYPED_DATA_WARNING #undef RUBY_UNTYPED_DATA_WARNING
#define RUBY_UNTYPED_DATA_WARNING 0 #define RUBY_UNTYPED_DATA_WARNING 0
path_guard = Data_Wrap_Struct((VALUE)0, NULL, RUBY_DEFAULT_FREE, NULL); path_guard = Data_Wrap_Struct((VALUE)0, NULL, RUBY_DEFAULT_FREE, NULL);
path = my_getcwd(); path = ruby_getcwd();
DATA_PTR(path_guard) = path; DATA_PTR(path_guard) = path;
#ifdef __APPLE__ #ifdef __APPLE__
cwd = rb_str_normalize_ospath(path, strlen(path)); cwd = rb_str_normalize_ospath(path, strlen(path));

8
file.c
View File

@ -3130,9 +3130,9 @@ getcwdofdrv(int drv)
of a particular drive is to change chdir() to that drive, of a particular drive is to change chdir() to that drive,
so save the old cwd before chdir() so save the old cwd before chdir()
*/ */
oldcwd = my_getcwd(); oldcwd = ruby_getcwd();
if (chdir(drive) == 0) { if (chdir(drive) == 0) {
drvcwd = my_getcwd(); drvcwd = ruby_getcwd();
chdir(oldcwd); chdir(oldcwd);
xfree(oldcwd); xfree(oldcwd);
} }
@ -3553,7 +3553,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
p = pend; p = pend;
} }
else { else {
char *e = append_fspath(result, fname, my_getcwd(), &enc, fsenc); char *e = append_fspath(result, fname, ruby_getcwd(), &enc, fsenc);
tainted = 1; tainted = 1;
BUFINIT(); BUFINIT();
p = e; p = e;
@ -5842,7 +5842,7 @@ path_check_0(VALUE path, int execpath)
char *p = 0, *s; char *p = 0, *s;
if (!rb_is_absolute_path(p0)) { if (!rb_is_absolute_path(p0)) {
char *buf = my_getcwd(); char *buf = ruby_getcwd();
VALUE newpath; VALUE newpath;
newpath = rb_str_new2(buf); newpath = rb_str_new2(buf);

View File

@ -70,7 +70,6 @@ char *ruby_strdup(const char *);
#define strdup(s) ruby_strdup(s) #define strdup(s) ruby_strdup(s)
char *ruby_getcwd(void); char *ruby_getcwd(void);
#define my_getcwd() ruby_getcwd()
double ruby_strtod(const char *, char **); double ruby_strtod(const char *, char **);
#undef strtod #undef strtod

View File

@ -3081,7 +3081,7 @@ rb_execarg_run_options(const struct rb_execarg *eargp, struct rb_execarg *sargp,
if (eargp->chdir_given) { if (eargp->chdir_given) {
if (sargp) { if (sargp) {
char *cwd = my_getcwd(); char *cwd = ruby_getcwd();
sargp->chdir_given = 1; sargp->chdir_given = 1;
sargp->chdir_dir = hide_obj(rb_str_new2(cwd)); sargp->chdir_dir = hide_obj(rb_str_new2(cwd));
xfree(cwd); xfree(cwd);