bug-bash
[Top][All Lists]
Advanced

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

savestring() macro in general.h runs function arguments twice.


From: John E. Malmberg
Subject: savestring() macro in general.h runs function arguments twice.
Date: Sat, 24 Nov 2012 01:32:51 -0600
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1

The execute_cmd.c module uses make_command_string() as a parameter to the savestring() macro.

This causes the savestring() macro to call that function twice().

I have not done any timing tests to see how this is impacting performance, but it definitely shows up when stepping through commands doing debugging.

This issue was first noticed in bash 1.14.7 and is also seen in the current bash 4.2.39.

I have locally patched execute_cmd.c to use an intermediate variable. The proper fix should probably be in general.h.

I did not find any other cases where a function was passed as a parameter.

Bash 4.2.39 on VMS is now able to run its own configure script and also the curl 7.20 configure script which is a bigger torture.

EAGLE> bash --version
GNU bash, version 4.2.39(1)-release (alpha-dec-vms)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
GNV-3.0-1-JEM-1 Nov 23 2012 09:17:12

Regards,
-John
address@hidden
Personal Opinion Only




reply via email to

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