Bug 47710 - Command line arguments not parsed correctly into argv variable
Summary: Command line arguments not parsed correctly into argv variable
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tcltk
Version: 7.1
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Jens Petersen
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-07-06 16:42 UTC by Kyle Bateman
Modified: 2005-10-31 22:00 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-07-06 16:42:34 UTC
Embargoed:


Attachments (Terms of Use)

Description Kyle Bateman 2001-07-06 16:42:31 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2-2 i686)

Description of problem:
There is discussion on comp.lang.tcl about what this problem is and how to
fix it (see the message header:  Re: BUG: TclX argv is wrong!!

I just built a single patch file from the messages and applied it against
the standard 7.1 src RPM (and tested it).

How reproducible:
Always

Steps to Reproduce:
1. create a wishx script test containing:
2. puts $argv
3. run script: ./test hello there
	

Actual Results:  output is:

hello there there

Expected Results:  hello there

Additional info:

patch file ready to drop into rpm as patch33:

--- tclX8.2.0/tk/generic/tkXshell.c     Sun Feb  6 17:54:00 2000
+++ tclX8.2.0/tk/generic/tkXshell.c.new Fri Jul  6 10:11:35 2001
@@ -191,12 +191,13 @@
     fileName = NULL;
     argi = 1;
     while ((argi < argc) && (argv[argi][0] == '-')) {
-        argi++;
         if (STREQU(argv[argi], "--")) {
-            break; /* end of options */
+          argi++;
+          break; /* end of options */
         } else if (!STREQU(argv[argi], "-sync")) {
-            argi++; /* takes an argument */
+          argi++; /* takes an argument */
         }
+        argi++;
     }
     /* Parse out file name, if supplied. */
     if (argi < argc) {
@@ -211,7 +212,7 @@
         while (argi < argc) {
             argv[i++] = argv[argi++];
         }
-        argc = i+1;
+        argc = i;
     }
 #else
     /*

Comment 1 Eido Inoue 2001-07-10 16:57:09 UTC
Thanks for the patch. Added for the next release/beta.


Note You need to log in before you can comment on or make changes to this bug.