[hackers] [lsw] cleanup || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Sat, 4 Jun 2011 20:27:38 +0200 (CEST)

changeset: 6:337aee7f4736
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Sat Jun 04 19:27:32 2011 +0100
files: lsw.c
description:
cleanup

diff -r 6bb1e6c3c9c0 -r 337aee7f4736 lsw.c
--- a/lsw.c Thu May 19 17:04:03 2011 +0100
+++ b/lsw.c Sat Jun 04 19:27:32 2011 +0100
@@ -10,7 +10,7 @@
 static void lsw(Window win);
 
 static Atom netwmname;
-static Bool longfmt = False;
+static Bool lflag = False;
 static Display *dpy;
 
 int
@@ -29,7 +29,7 @@
                         exit(EXIT_SUCCESS);
                 }
                 else if(!strcmp(argv[i], "-l"))
- longfmt = True;
+ lflag = True;
                 else
                         break;
 
@@ -38,6 +38,7 @@
         while(i < argc)
                 lsw(strtol(argv[i++], NULL, 0));
 
+ XCloseDisplay(dpy);
         return EXIT_SUCCESS;
 }
 
@@ -53,9 +54,9 @@
         for(i = 0; i < n; i++)
                 if(XGetWindowAttributes(dpy, win, &wa) && !wa.override_redirect) {
                         getname(wins[i], buf, sizeof buf);
- if(longfmt)
+ if(lflag)
                                 printf("0x%07lx %s\n", wins[i], buf);
- else if(buf[0] != '\0')
+ else if(*buf)
                                 puts(buf);
                 }
         XFree(wins);
Received on Sat Jun 04 2011 - 20:27:38 CEST

This archive was generated by hypermail 2.2.0 : Sat Jun 04 2011 - 20:36:04 CEST