bug-readline
[Top][All Lists]
Advanced

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

Making history_value's input parameter const


From: Simon Marchi
Subject: Making history_value's input parameter const
Date: Thu, 15 Dec 2022 12:03:07 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

Hi,

This is more or less a small change request.  I can provide a patch as a
starting point if it helps, but I'm not familiar with readline
development so it's probably faster for someone else to do it.

In GDB, I'd like to pass a pointer to a string that should not be
modified (the result of std::string::c_str) to readline's history_expand
function.  The input parameter to that function is currently a `char *`,
but I don't think it needs to be.  I was able to hack in the constness
in binutils-gdb's internal readline tree, so I think it's possible to
change the parameter to `const char *`.  And I think it would be a nice
change in general, to indicate to the caller that "I won't modify your
string".

Thanks,

Simon



reply via email to

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