Strange Win32 ARGV problem

  • Thread starter Bennett, Patrick
  • Start date
B

Bennett, Patrick

(reposting in plain text...)


Using the following one line ruby script (to dump out argv):
puts "ARGV:\n#{ARGV.join("\n")}\n---"
I'm seeing VERY strange behavior with Ruby 1.8.0:

First, I'll show that 4 different files exist in a local directory.

M:\builds\SYStest\eic\Yellow\products\EIC\src\attendant>dir
audiodetaildlg.*
Volume in drive M is WorkDrive3
Volume Serial Number is 90DB-A0F3

Directory of M:\builds\SYStest\eic\Yellow\products\EIC\src\attendant

09/04/2002 03:15 PM 3,817 AudioDetailDlg.cpp
03/25/2003 05:00 PM 1,498 AudioDetailDlg.h
2 File(s) 5,315 bytes
0 Dir(s) 6,820,958,208 bytes free

M:\builds\SYStest\eic\Yellow\products\EIC\src\attendant>dir audionode.*
Volume in drive M is WorkDrive3
Volume Serial Number is 90DB-A0F3

Directory of M:\builds\SYStest\eic\Yellow\products\EIC\src\attendant

08/01/2002 02:25 PM 3,409 AudioNode.cpp
07/31/2002 04:07 PM 1,849 AudioNode.h
2 File(s) 5,258 bytes
0 Dir(s) 6,820,958,208 bytes free

Now, I'll run the script that dumps out argv and pass it some wildcard
arguments which should match these files.

M:\builds\SYStest\eic\Yellow\products\EIC\src\attendant>ruby bs.rb test
AudioDetailDlg.* AudioNode.*
ARGV:
test
AudioDetailDlg.* AudioNode.*
---

Huh? Why did the two arguments get passed in as one argument to argv !?
This is causing some of my scripts serious problems. :(

M:\builds\SYStest\eic\Yellow\products\EIC\src\attendant>ruby bs.rb test
AudioDetailDlg.*
ARGV:
test
AudioDetailDlg.cpp
AudioDetailDlg.h
---
Hmmm.... now it performed wildcard expansion and put the two files as
separate arguments.
Basically, the first option after a wildcard argument gets grouped in
with that wildcard parameter as a single argument and the expansion
doesn't occur.

M:\builds\SYStest\eic\Yellow\products\EIC\src\attendant>ruby bs.rb test
AudioDetailDlg.* foo AudioNode.*
ARGV:
test
AudioDetailDlg.* foo
AudioNode.cpp
AudioNode.h
 
N

nobu.nokada

Hi,

At Fri, 3 Oct 2003 07:50:34 +0900,
Now, I'll run the script that dumps out argv and pass it some wildcard
arguments which should match these files.

M:\builds\SYStest\eic\Yellow\products\EIC\src\attendant>ruby bs.rb test
AudioDetailDlg.* AudioNode.*
ARGV:
test
AudioDetailDlg.* AudioNode.*

Sorry, it was a bug.

Sat Sep 6 00:36:20 2003 Nobuyoshi Nakada <[email protected]>

* win32/win32.c (make_cmdvector): a character just after wildcard
was ignored. [ruby-core:01518]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top