1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* file.c (rb_file_s_basename): DOSISH_UNC is defined on cygwin but

DOSISH is not.  fixed: [ruby-dev:27797]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2005-11-21 16:47:13 +00:00
parent cc24146adc
commit 1ce26d09fe
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Tue Nov 22 01:45:21 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_s_basename): DOSISH_UNC is defined on cygwin but
DOSISH is not. fixed: [ruby-dev:27797]
Mon Nov 21 22:50:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> Mon Nov 21 22:50:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_path_skip_prefix, rb_file_s_basename): UNC without path * file.c (rb_path_skip_prefix, rb_file_s_basename): UNC without path

6
file.c
View file

@ -2573,7 +2573,7 @@ rb_file_s_basename(int argc, VALUE *argv)
{ {
VALUE fname, fext, basename; VALUE fname, fext, basename;
char *name, *p; char *name, *p;
#ifdef DOSISH #if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
char *root; char *root;
#endif #endif
int f; int f;
@ -2585,7 +2585,7 @@ rb_file_s_basename(int argc, VALUE *argv)
if (RSTRING(fname)->len == 0 || !*(name = RSTRING(fname)->ptr)) if (RSTRING(fname)->len == 0 || !*(name = RSTRING(fname)->ptr))
return fname; return fname;
name = skipprefix(name); name = skipprefix(name);
#ifdef DOSISH #if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
root = name; root = name;
#endif #endif
while (isdirsep(*name)) while (isdirsep(*name))
@ -2593,7 +2593,7 @@ rb_file_s_basename(int argc, VALUE *argv)
if (!*name) { if (!*name) {
p = name - 1; p = name - 1;
f = 1; f = 1;
#ifdef DOSISH #if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
if (name != root) { if (name != root) {
/* has slashes */ /* has slashes */
} }