This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[RFC] maint.c, move assignment to outside of IF expr
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [RFC] maint.c, move assignment to outside of IF expr
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Tue, 28 Mar 2000 15:34:10 +1000
- Organization: Cygnus Solutions
OK?
The attatched moves an assignment out of an if conditional. GCC was
complaining about it.
I'm guessing that the coder didn't intend to write ``=='' :-)
enjoy,
Andrew
Tue Mar 28 15:20:14 2000 Andrew Cagney <cagney@b1.cygnus.com>
* maint.c (maintenance_do_deprecate): Avoid assignment within IF
condition.
Index: maint.c
===================================================================
RCS file: /cvs/src/src/gdb/maint.c,v
retrieving revision 1.6
diff -p -r1.6 maint.c
*** maint.c 2000/03/25 15:32:18 1.6
--- maint.c 2000/03/28 05:25:57
*************** maintenance_do_deprecate (char *text, in
*** 425,434 ****
if (deprecate)
{
/* look for a replacement command */
! if (start_ptr = strchr (text, '\"'))
{
start_ptr++;
! if (end_ptr = strrchr (start_ptr, '\"'))
{
len = end_ptr - start_ptr;
start_ptr[len] = '\0';
--- 425,436 ----
if (deprecate)
{
/* look for a replacement command */
! start_ptr = strchr (text, '\"');
! if (start_ptr != NULL)
{
start_ptr++;
! end_ptr = strrchr (start_ptr, '\"');
! if (end_ptr != NULL)
{
len = end_ptr - start_ptr;
start_ptr[len] = '\0';