[RFC] maint.c, move assignment to outside of IF expr

Andrew Cagney ac131313@cygnus.com
Mon Mar 27 21:35:00 GMT 2000


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';


More information about the Gdb-patches mailing list