bugGNU Wget - Bugs: bug #20388, Don't use global var to determine...

 
 

bug #20388: Don't use global var to determine tilde-expansion

Submitter:  Micah Cowan <micahcowan>
Submitted:  Fri 06 Jul 2007 11:17:50 PM UTC
   
 
Category:  Feature Request Severity:  1 - Wish
Priority:  1 - Later Status:  Fixed
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  None Operating System:  None
Reproducibility:  None Fixed Release:  1.12
Planned Release:  1.14 Regression:  None
Work Required:  0 - Hours Patch Included:  Yes
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 14 Jun 2009 12:36:26 AM UTC, comment #4: 

Fixed in 60a504123112.

Micah Cowan <micahcowan>
Sat 13 Jun 2009 08:49:57 PM UTC, comment #3: 

stsc also has a modified version of jpichon's patch, which modifies the command signature to take an int, instead of wrapping the int-taking tilde-flag thing to fit the command signature.

http://stsc.refcnt.org/src/wget/init.c.patch

Micah Cowan <micahcowan>
Sat 13 Jun 2009 05:53:52 PM UTC, comment #2: 
Micah Cowan <micahcowan>
Thu 26 Feb 2009 03:20:43 PM UTC, comment #1: 

I think we can't get easily ride of this global variable. Here is
a simplified view of the code lay-out:

static int bool enable_tilde_expansion = false;

run_wgetrc
{
 enable_tilde_expansion = true;

 while()
  {
      cmd_file(com, val, place);
  }

 enable_tilde_expansion = false;
}

static bool cmd_file(char *com, char *val, void *place)
{
 if(enable_tilde_expansion)
   do_something();
}



The first idea we can have is to add a new parameter to the
function cmd_file, but this function is pointed to by a pointer
of type: bool (ptr)(char, char , void ), and is used
several times to call the cmd_file (line 900, line 905, line 910)
in the file main.c.

So we can't add a new parameter to this function, and must
change the behavior thanks to a global variable.

Pichon Julien <jpichon>
Fri 06 Jul 2007 11:17:50 PM UTC, original submission:  

tilde-expansion very likely doesn't need its own global variable, just to enable it for one spot!!

Micah Cowan <micahcowan>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jpichon (Posted a comment)
  • -email is unavailable- added by micahcowan (Submitted the item)
  •  

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-06-14 micahcowan StatusConfirmed Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 1.12
    2009-06-13 micahcowan Patch IncludedNone Yes
    2009-06-13 micahcowan Planned Release1.15 1.14
    2008-01-27 micahcowan Planned Release1.12 1.15
    2007-07-31 micahcowan Priority5 - Normal 1 - Later
    2007-07-20 micahcowan Planned ReleaseNone 1.12

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code