Bug 47710 - Command line arguments not parsed correctly into argv variable
Command line arguments not parsed correctly into argv variable
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: tcltk (Show other bugs)
7.1
All Linux
high Severity high
: ---
: ---
Assigned To: Jens Petersen
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-07-06 12:42 EDT by Kyle Bateman
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-06 12:42:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kyle Bateman 2001-07-06 12:42:31 EDT
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 12:57:09 EDT
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.