Fix loop on selection. - sam - An updated version of the sam text editor.
 (HTM) git clone git://vernunftzentrum.de/sam.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit e3db7a503de6e0b49d224225da597a1bee0b89f5
 (DIR) parent c27bc210c40768c6ff027b7fe505cec34bcdbb13
 (HTM) Author: Rob King <jking@deadpixi.com>
       Date:   Wed,  7 Dec 2016 15:52:03 -0600
       
       Fix loop on selection.
       
       Diffstat:
         libXg/gwin.c                        |       6 ++++++
       
       1 file changed, 6 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/libXg/gwin.c b/libXg/gwin.c
       @@ -525,6 +525,12 @@ SelCallback(Widget w, XtPointer cldata, Atom *sel, Atom *seltype,
            XTextProperty p = {0};
            char *ls[2] = {(char *)val, NULL};
        
       +    if (*seltype == 0){
       +        if (gw->gwin.selection == NULL)
       +            gw->gwin.selection = strdup("");
       +        return;
       +    }
       +
            if(gw->gwin.selection){
                XtFree(gw->gwin.selection);
                gw->gwin.selection = NULL;