T
ThoML
Hi,
I just realized that the result of
File.extname("foo bar")
is
=> " bar"
I have to admit this comes unexpected. In file.c, I found this
#if USE_NTFS
#define istrailinggabage(x) ((x) == '.' || (x) == ' ')
#else
#define istrailinggabage(x) 0
#endif
and
#if defined _WIN32 || defined __CYGWIN__
#define USE_NTFS 1
#else
#define USE_NTFS 0
#endif
Is this intentional? Could somebody please explain.
This is on
ruby 1.8.7 (2008-06-20 patchlevel 22) [i386-cygwin]
and
ruby 1.9.0 (2008-06-20 revision 17482) [i386-cygwin]
With ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] the result is
closer to what I'd expect:
$ /cygdrive/c/ruby/bin/ruby -e "p File.extname('foo bar')"
""
Thanks,
Thomas.
I just realized that the result of
File.extname("foo bar")
is
=> " bar"
I have to admit this comes unexpected. In file.c, I found this
#if USE_NTFS
#define istrailinggabage(x) ((x) == '.' || (x) == ' ')
#else
#define istrailinggabage(x) 0
#endif
and
#if defined _WIN32 || defined __CYGWIN__
#define USE_NTFS 1
#else
#define USE_NTFS 0
#endif
Is this intentional? Could somebody please explain.
This is on
ruby 1.8.7 (2008-06-20 patchlevel 22) [i386-cygwin]
and
ruby 1.9.0 (2008-06-20 revision 17482) [i386-cygwin]
With ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] the result is
closer to what I'd expect:
$ /cygdrive/c/ruby/bin/ruby -e "p File.extname('foo bar')"
""
Thanks,
Thomas.