]> code.delx.au - gnu-emacs/blobdiff - lwlib/lwlib-Xm.c
Make `initials' completion work for /hh -> /home/horn again (bug#5524).
[gnu-emacs] / lwlib / lwlib-Xm.c
index f15bbdf7b39fde28844d57c9f26762ead35bc541..ed203e26bf42f198e6fca84c2bf8096570c091e0 100644 (file)
@@ -1,13 +1,14 @@
 /* The lwlib interface to Motif widgets.
    Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
 /* The lwlib interface to Motif widgets.
    Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
-                 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+                 2004, 2005, 2006, 2007, 2008, 2009, 2010
+                 Free Software Foundation, Inc.
    Copyright (C) 1992 Lucid, Inc.
 
 This file is part of the Lucid Widget Library.
 
 The Lucid Widget Library is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as published by
    Copyright (C) 1992 Lucid, Inc.
 
 This file is part of the Lucid Widget Library.
 
 The Lucid Widget Library is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 1, or (at your option)
 any later version.
 
 The Lucid Widget Library is distributed in the hope that it will be useful,
 any later version.
 
 The Lucid Widget Library is distributed in the hope that it will be useful,
@@ -26,6 +27,7 @@ Boston, MA 02110-1301, USA.  */
 
 #include <unistd.h>
 #include <stdio.h>
 
 #include <unistd.h>
 #include <stdio.h>
+#include <setjmp.h>
 
 #include <X11/StringDefs.h>
 #include <X11/IntrinsicP.h>
 
 #include <X11/StringDefs.h>
 #include <X11/IntrinsicP.h>
@@ -956,15 +958,13 @@ xm_update_one_value (instance, widget, val)
     }
   else if (class == xmTextWidgetClass)
     {
     }
   else if (class == xmTextWidgetClass)
     {
-      if (val->value)
-       free (val->value);
+      free (val->value);
       val->value = XmTextGetString (widget);
       val->edited = True;
     }
   else if (class == xmTextFieldWidgetClass)
     {
       val->value = XmTextGetString (widget);
       val->edited = True;
     }
   else if (class == xmTextFieldWidgetClass)
     {
-      if (val->value)
-       free (val->value);
+      free (val->value);
       val->value = XmTextFieldGetString (widget);
       val->edited = True;
     }
       val->value = XmTextFieldGetString (widget);
       val->edited = True;
     }
@@ -989,8 +989,7 @@ xm_update_one_value (instance, widget, val)
              XtVaGetValues (toggle, XmNset, &set, NULL);
              if (set)
                {
              XtVaGetValues (toggle, XmNset, &set, NULL);
              if (set)
                {
-                 if (val->value)
-                   free (val->value);
+                 free (val->value);
                  val->value = safe_strdup (XtName (toggle));
                }
            }
                  val->value = safe_strdup (XtName (toggle));
                }
            }