diff options
| author | arg@mig29 <unknown> | 2006-10-31 08:43:25 +0100 |
|---|---|---|
| committer | arg@mig29 <unknown> | 2006-10-31 08:43:25 +0100 |
| commit | ff79c382c5d1c83c8e771223cbb99bc0e87be697 (patch) | |
| tree | fdfa3f5a661d1f1234621317b395c4588f355255 | |
| parent | 27d8d248275ca3eb63882202dcc21ecf2f81e72a (diff) | |
small fix of Vincent's patch
| -rw-r--r-- | config.mk | 2 | ||||
| -rw-r--r-- | slock.c | 13 |
2 files changed, 7 insertions, 8 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | # slock version | 1 | # slock version |
| 2 | VERSION = 0.2 | 2 | VERSION = 0.3 |
| 3 | 3 | ||
| 4 | # Customize below to fit your system | 4 | # Customize below to fit your system |
| 5 | 5 | ||
| @@ -2,6 +2,9 @@ | |||
| 2 | * See LICENSE file for license details. | 2 | * See LICENSE file for license details. |
| 3 | */ | 3 | */ |
| 4 | #define _XOPEN_SOURCE 500 | 4 | #define _XOPEN_SOURCE 500 |
| 5 | #if HAVE_SHADOW_H | ||
| 6 | #include <shadow.h> | ||
| 7 | #endif | ||
| 5 | 8 | ||
| 6 | #include <ctype.h> | 9 | #include <ctype.h> |
| 7 | #include <pwd.h> | 10 | #include <pwd.h> |
| @@ -9,9 +12,6 @@ | |||
| 9 | #include <stdio.h> | 12 | #include <stdio.h> |
| 10 | #include <string.h> | 13 | #include <string.h> |
| 11 | #include <unistd.h> | 14 | #include <unistd.h> |
| 12 | #if HAVE_SHADOW_H | ||
| 13 | #include <shadow.h> | ||
| 14 | #endif | ||
| 15 | #include <sys/types.h> | 15 | #include <sys/types.h> |
| 16 | #include <X11/keysym.h> | 16 | #include <X11/keysym.h> |
| 17 | #include <X11/Xlib.h> | 17 | #include <X11/Xlib.h> |
| @@ -75,8 +75,6 @@ main(int argc, char **argv) { | |||
| 75 | screen = DefaultScreen(dpy); | 75 | screen = DefaultScreen(dpy); |
| 76 | 76 | ||
| 77 | /* init */ | 77 | /* init */ |
| 78 | len = 0; | ||
| 79 | |||
| 80 | wa.override_redirect = 1; | 78 | wa.override_redirect = 1; |
| 81 | wa.background_pixel = BlackPixel(dpy, screen); | 79 | wa.background_pixel = BlackPixel(dpy, screen); |
| 82 | w = XCreateWindow(dpy, RootWindow(dpy, screen), 0, 0, | 80 | w = XCreateWindow(dpy, RootWindow(dpy, screen), 0, 0, |
| @@ -96,6 +94,7 @@ main(int argc, char **argv) { | |||
| 96 | GrabModeAsync, CurrentTime) != GrabSuccess); len--) | 94 | GrabModeAsync, CurrentTime) != GrabSuccess); len--) |
| 97 | usleep(1000); | 95 | usleep(1000); |
| 98 | running = running && (len > 0); | 96 | running = running && (len > 0); |
| 97 | len = 0; | ||
| 99 | XMapRaised(dpy, w); | 98 | XMapRaised(dpy, w); |
| 100 | XSync(dpy, False); | 99 | XSync(dpy, False); |
| 101 | 100 | ||
| @@ -120,11 +119,11 @@ main(int argc, char **argv) { | |||
| 120 | break; | 119 | break; |
| 121 | case XK_BackSpace: | 120 | case XK_BackSpace: |
| 122 | if(len) | 121 | if(len) |
| 123 | --len; | 122 | --len; |
| 124 | break; | 123 | break; |
| 125 | default: | 124 | default: |
| 126 | if(num && !iscntrl((int) buf[0])) { | 125 | if(num && !iscntrl((int) buf[0])) { |
| 127 | memcpy(passwd + len,buf,num); | 126 | memcpy(passwd + len, buf, num); |
| 128 | len += num; | 127 | len += num; |
| 129 | } | 128 | } |
| 130 | break; | 129 | break; |
