bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] [PATCH 20/25] New option --metalink-index to process Meta


From: Giuseppe Scrivano
Subject: Re: [Bug-wget] [PATCH 20/25] New option --metalink-index to process Metalink application/metalink4+xml
Date: Thu, 15 Sep 2016 09:11:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hi Matthew,

Matthew White <address@hidden> writes:

>> > Function amended to modify *name in place.
>> >
>> > Followed Tim's suggestions for Patch 09/25 about different environments 
>> > compatibility, the function now uses last_component() to detect the 
>> > basename:
>> > http://lists.gnu.org/archive/html/bug-wget/2016-09/msg00083.html
>> >
>> > NOTES: if *name is NULL and ref is like 'dir/C:D:file', the result will be 
>> > 'C:D:file'; is it advisable to remove the drive letters 'C:D:' and return 
>> > only 'file'?
>> >
>> > /*
>> >   Replace/remove the basename of a file name.
>> >
>> >   The file name is permanently modified.
>> >
>> >   Always set NAME to a string, even an empty one.
>> >
>> >   Use REF's basename as replacement.  If REF is NULL or if it doesn't
>> >   provide a valid basename candidate, then remove NAME's basename.
>> > */
>> > void
>> > replace_metalink_basename (char **name, char *ref)
>> > {
>> 
>> is it something we could do using only dirname and basename?  What you
>> need here is "dirname(name) + basename(ref)"?
>
> You asked to avoid superfluous memory allocations, right?

yes, and that is still my idea.  I was just wondering if the cost of
these extra memory allocations was worth.  Is it enough to use
last_component() to get it working on Windows?

Thanks,
Giuseppe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]