cleaned up code
dc5d967e
8 file(s) · +78 −85
| 97 | 97 | getclient(Window w) |
|
| 98 | 98 | { |
|
| 99 | 99 | Client *c; |
|
| 100 | + | ||
| 100 | 101 | for(c = clients; c; c = c->next) |
|
| 101 | 102 | if(c->win == w) |
|
| 102 | 103 | return c; |
|
| 107 | 108 | getctitle(Window w) |
|
| 108 | 109 | { |
|
| 109 | 110 | Client *c; |
|
| 111 | + | ||
| 110 | 112 | for(c = clients; c; c = c->next) |
|
| 111 | 113 | if(c->title == w) |
|
| 112 | 114 | return c; |
|
| 198 | 200 | { |
|
| 199 | 201 | int diff; |
|
| 200 | 202 | Client *c; |
|
| 201 | - | XSetWindowAttributes twa; |
|
| 202 | 203 | Window trans; |
|
| 204 | + | XSetWindowAttributes twa; |
|
| 203 | 205 | ||
| 204 | 206 | c = emallocz(sizeof(Client)); |
|
| 205 | 207 | c->win = w; |
|
| 278 | 280 | pop(Client *c) |
|
| 279 | 281 | { |
|
| 280 | 282 | Client **l; |
|
| 283 | + | ||
| 281 | 284 | for(l = &clients; *l && *l != c; l = &(*l)->next); |
|
| 282 | 285 | *l = c->next; |
|
| 283 | 286 | ||
| 289 | 292 | void |
|
| 290 | 293 | resize(Client *c, Bool inc, Corner sticky) |
|
| 291 | 294 | { |
|
| 292 | - | XConfigureEvent e; |
|
| 295 | + | int bottom = c->y + c->h; |
|
| 293 | 296 | int right = c->x + c->w; |
|
| 294 | - | int bottom = c->y + c->h; |
|
| 297 | + | XConfigureEvent e; |
|
| 295 | 298 | ||
| 296 | 299 | if(inc) { |
|
| 297 | 300 | if(c->incw) |
|
| 337 | 340 | void |
|
| 338 | 341 | setsize(Client *c) |
|
| 339 | 342 | { |
|
| 343 | + | long msize; |
|
| 340 | 344 | XSizeHints size; |
|
| 341 | - | long msize; |
|
| 345 | + | ||
| 342 | 346 | if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags) |
|
| 343 | 347 | size.flags = PSize; |
|
| 344 | 348 | c->flags = size.flags; |
|
| 375 | 379 | void |
|
| 376 | 380 | settitle(Client *c) |
|
| 377 | 381 | { |
|
| 378 | - | XTextProperty name; |
|
| 379 | - | int n; |
|
| 380 | 382 | char **list = NULL; |
|
| 383 | + | int n; |
|
| 384 | + | XTextProperty name; |
|
| 381 | 385 | ||
| 382 | 386 | name.nitems = 0; |
|
| 383 | 387 | c->name[0] = 0; |
|
| 7 | 7 | X11INC = /usr/X11R6/include |
|
| 8 | 8 | X11LIB = /usr/X11R6/lib |
|
| 9 | 9 | ||
| 10 | - | VERSION = 0.4 |
|
| 10 | + | VERSION = 0.5 |
|
| 11 | 11 | ||
| 12 | 12 | # includes and libs |
|
| 13 | 13 | LIBS = -L${PREFIX}/lib -L/usr/lib -lc -L${X11LIB} -lX11 |
| 14 | 14 | drawborder(void) |
|
| 15 | 15 | { |
|
| 16 | 16 | XPoint points[5]; |
|
| 17 | + | ||
| 17 | 18 | XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); |
|
| 18 | 19 | XSetForeground(dpy, dc.gc, dc.border); |
|
| 19 | 20 | points[0].x = dc.x; |
|
| 33 | 34 | textnw(char *text, unsigned int len) |
|
| 34 | 35 | { |
|
| 35 | 36 | XRectangle r; |
|
| 37 | + | ||
| 36 | 38 | if(dc.font.set) { |
|
| 37 | 39 | XmbTextExtents(dc.font.set, text, len, NULL, &r); |
|
| 38 | 40 | return r.width; |
|
| 44 | 46 | drawtext(const char *text, Bool invert, Bool border) |
|
| 45 | 47 | { |
|
| 46 | 48 | int x, y, w, h; |
|
| 47 | - | unsigned int len; |
|
| 48 | 49 | static char buf[256]; |
|
| 50 | + | unsigned int len; |
|
| 49 | 51 | XGCValues gcv; |
|
| 50 | 52 | XRectangle r = { dc.x, dc.y, dc.w, dc.h }; |
|
| 51 | 53 | ||
| 170 | 172 | unsigned long |
|
| 171 | 173 | getcolor(const char *colstr) |
|
| 172 | 174 | { |
|
| 173 | - | XColor color; |
|
| 174 | 175 | Colormap cmap = DefaultColormap(dpy, screen); |
|
| 176 | + | XColor color; |
|
| 175 | 177 | ||
| 176 | 178 | XAllocNamedColor(dpy, cmap, colstr, &color, &color); |
|
| 177 | 179 | return color.pixel; |
|
| 1 | - | .TH DWM 1 dwm-0.4 |
|
| 1 | + | .TH DWM 1 dwm-0.5 |
|
| 2 | 2 | .SH NAME |
|
| 3 | 3 | dwm \- dynamic window manager |
|
| 4 | 4 | .SH SYNOPSIS |
| 20 | 20 | Arg arg; |
|
| 21 | 21 | } Key; |
|
| 22 | 22 | ||
| 23 | - | /* |
|
| 24 | 23 | const char *browse[] = { "firefox", NULL }; |
|
| 25 | 24 | const char *gimp[] = { "gimp", NULL }; |
|
| 26 | - | */ |
|
| 27 | - | const char *term[] = { "xterm", NULL }; |
|
| 28 | - | /* |
|
| 25 | + | const char *term[] = { |
|
| 29 | 26 | "urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white", |
|
| 30 | 27 | "-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL |
|
| 31 | 28 | }; |
|
| 32 | - | coonst char *xlock[] = { "xlock", NULL }; |
|
| 33 | - | */ |
|
| 29 | + | const char *xlock[] = { "xlock", NULL }; |
|
| 34 | 30 | ||
| 35 | 31 | static Key key[] = { |
|
| 36 | - | /* modifier key function arguments */ |
|
| 37 | - | { ControlMask, XK_0, appendtag, { .i = Tscratch } }, |
|
| 38 | - | { ControlMask, XK_1, appendtag, { .i = Tdev } }, |
|
| 39 | - | { ControlMask, XK_2, appendtag, { .i = Twww } }, |
|
| 40 | - | { ControlMask, XK_3, appendtag, { .i = Twork } }, |
|
| 41 | - | { MODKEY, XK_0, view, { .i = Tscratch } }, |
|
| 42 | - | { MODKEY, XK_1, view, { .i = Tdev } }, |
|
| 43 | - | { MODKEY, XK_2, view, { .i = Twww } }, |
|
| 44 | - | { MODKEY, XK_3, view, { .i = Twork } }, |
|
| 45 | - | { MODKEY, XK_j, focusnext, { 0 } }, |
|
| 46 | - | { MODKEY, XK_k, focusprev, { 0 } }, |
|
| 47 | - | { MODKEY, XK_m, maximize, { 0 } }, |
|
| 48 | - | { MODKEY, XK_space, dotile, { 0 } }, |
|
| 49 | - | { MODKEY, XK_Return, zoom, { 0 } }, |
|
| 32 | + | /* modifier key function arguments */ |
|
| 33 | + | { ControlMask, XK_0, appendtag, { .i = Tscratch } }, |
|
| 34 | + | { ControlMask, XK_1, appendtag, { .i = Tdev } }, |
|
| 35 | + | { ControlMask, XK_2, appendtag, { .i = Twww } }, |
|
| 36 | + | { ControlMask, XK_3, appendtag, { .i = Twork } }, |
|
| 37 | + | { MODKEY, XK_0, view, { .i = Tscratch } }, |
|
| 38 | + | { MODKEY, XK_1, view, { .i = Tdev } }, |
|
| 39 | + | { MODKEY, XK_2, view, { .i = Twww } }, |
|
| 40 | + | { MODKEY, XK_3, view, { .i = Twork } }, |
|
| 41 | + | { MODKEY, XK_j, focusnext, { 0 } }, |
|
| 42 | + | { MODKEY, XK_k, focusprev, { 0 } }, |
|
| 43 | + | { MODKEY, XK_m, maximize, { 0 } }, |
|
| 44 | + | { MODKEY, XK_space, dotile, { 0 } }, |
|
| 45 | + | { MODKEY, XK_Return, zoom, { 0 } }, |
|
| 50 | 46 | { ControlMask|ShiftMask,XK_0, heretag, { .i = Tscratch } }, |
|
| 51 | 47 | { ControlMask|ShiftMask,XK_1, heretag, { .i = Tdev } }, |
|
| 52 | 48 | { ControlMask|ShiftMask,XK_2, heretag, { .i = Twww } }, |
|
| 53 | 49 | { ControlMask|ShiftMask,XK_3, heretag, { .i = Twork } }, |
|
| 54 | - | { MODKEY|ShiftMask, XK_0, replacetag, { .i = Tscratch } }, |
|
| 55 | - | { MODKEY|ShiftMask, XK_1, replacetag, { .i = Tdev } }, |
|
| 56 | - | { MODKEY|ShiftMask, XK_2, replacetag, { .i = Twww } }, |
|
| 57 | - | { MODKEY|ShiftMask, XK_3, replacetag, { .i = Twork } }, |
|
| 58 | - | { MODKEY|ShiftMask, XK_c, killclient, { 0 } }, |
|
| 59 | - | /* |
|
| 60 | - | { MODKEY|ShiftMask, XK_g, spawn, { .argv = gimp } }, |
|
| 61 | - | { MODKEY|ShiftMask, XK_l, spawn, { .argv = xlock } }, |
|
| 62 | - | */ |
|
| 63 | - | { MODKEY|ShiftMask, XK_q, quit, { 0 } }, |
|
| 64 | - | { MODKEY|ShiftMask, XK_space, dofloat, { 0 } }, |
|
| 65 | - | /*{ MODKEY|ShiftMask, XK_w, spawn, { .argv = browse } },*/ |
|
| 66 | - | { MODKEY|ShiftMask, XK_Return, spawn, { .argv = term } }, |
|
| 50 | + | { MODKEY|ShiftMask, XK_0, replacetag, { .i = Tscratch } }, |
|
| 51 | + | { MODKEY|ShiftMask, XK_1, replacetag, { .i = Tdev } }, |
|
| 52 | + | { MODKEY|ShiftMask, XK_2, replacetag, { .i = Twww } }, |
|
| 53 | + | { MODKEY|ShiftMask, XK_3, replacetag, { .i = Twork } }, |
|
| 54 | + | { MODKEY|ShiftMask, XK_c, killclient, { 0 } }, |
|
| 55 | + | { MODKEY|ShiftMask, XK_g, spawn, { .argv = gimp } }, |
|
| 56 | + | { MODKEY|ShiftMask, XK_l, spawn, { .argv = xlock } }, |
|
| 57 | + | { MODKEY|ShiftMask, XK_q, quit, { 0 } }, |
|
| 58 | + | { MODKEY|ShiftMask, XK_space, dofloat, { 0 } }, |
|
| 59 | + | { MODKEY|ShiftMask, XK_w, spawn, { .argv = browse } }, |
|
| 60 | + | { MODKEY|ShiftMask, XK_Return, spawn, { .argv = term } }, |
|
| 67 | 61 | }; |
|
| 68 | 62 | ||
| 69 | 63 | /* static */ |
|
| 71 | 65 | static void |
|
| 72 | 66 | movemouse(Client *c) |
|
| 73 | 67 | { |
|
| 74 | - | XEvent ev; |
|
| 75 | 68 | int x1, y1, ocx, ocy, di; |
|
| 76 | 69 | unsigned int dui; |
|
| 77 | 70 | Window dummy; |
|
| 71 | + | XEvent ev; |
|
| 78 | 72 | ||
| 79 | 73 | ocx = c->x; |
|
| 80 | 74 | ocy = c->y; |
|
| 81 | 75 | if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync, |
|
| 82 | - | None, cursor[CurMove], CurrentTime) != GrabSuccess) |
|
| 76 | + | None, cursor[CurMove], CurrentTime) != GrabSuccess) |
|
| 83 | 77 | return; |
|
| 84 | 78 | XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui); |
|
| 85 | 79 | for(;;) { |
|
| 105 | 99 | static void |
|
| 106 | 100 | resizemouse(Client *c) |
|
| 107 | 101 | { |
|
| 108 | - | XEvent ev; |
|
| 109 | 102 | int ocx, ocy; |
|
| 110 | 103 | Corner sticky; |
|
| 104 | + | XEvent ev; |
|
| 111 | 105 | ||
| 112 | 106 | ocx = c->x; |
|
| 113 | 107 | ocy = c->y; |
|
| 146 | 140 | { |
|
| 147 | 141 | int x; |
|
| 148 | 142 | Arg a; |
|
| 149 | - | XButtonPressedEvent *ev = &e->xbutton; |
|
| 150 | 143 | Client *c; |
|
| 144 | + | XButtonPressedEvent *ev = &e->xbutton; |
|
| 151 | 145 | ||
| 152 | 146 | if(barwin == ev->window) { |
|
| 153 | 147 | switch(ev->button) { |
|
| 201 | 195 | static void |
|
| 202 | 196 | configurerequest(XEvent *e) |
|
| 203 | 197 | { |
|
| 198 | + | Client *c; |
|
| 204 | 199 | XConfigureRequestEvent *ev = &e->xconfigurerequest; |
|
| 205 | 200 | XWindowChanges wc; |
|
| 206 | - | Client *c; |
|
| 207 | 201 | ||
| 208 | 202 | ev->value_mask &= ~CWSibling; |
|
| 209 | 203 | if((c = getclient(ev->window))) { |
|
| 248 | 242 | static void |
|
| 249 | 243 | enternotify(XEvent *e) |
|
| 250 | 244 | { |
|
| 251 | - | XCrossingEvent *ev = &e->xcrossing; |
|
| 252 | 245 | Client *c; |
|
| 246 | + | XCrossingEvent *ev = &e->xcrossing; |
|
| 253 | 247 | ||
| 254 | 248 | if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) |
|
| 255 | 249 | return; |
|
| 263 | 257 | static void |
|
| 264 | 258 | expose(XEvent *e) |
|
| 265 | 259 | { |
|
| 266 | - | XExposeEvent *ev = &e->xexpose; |
|
| 267 | 260 | Client *c; |
|
| 261 | + | XExposeEvent *ev = &e->xexpose; |
|
| 268 | 262 | ||
| 269 | 263 | if(ev->count == 0) { |
|
| 270 | 264 | if(barwin == ev->window) |
|
| 277 | 271 | static void |
|
| 278 | 272 | keypress(XEvent *e) |
|
| 279 | 273 | { |
|
| 280 | - | XKeyEvent *ev = &e->xkey; |
|
| 281 | 274 | static unsigned int len = key ? sizeof(key) / sizeof(key[0]) : 0; |
|
| 282 | 275 | unsigned int i; |
|
| 283 | 276 | KeySym keysym; |
|
| 277 | + | XKeyEvent *ev = &e->xkey; |
|
| 284 | 278 | ||
| 285 | 279 | keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); |
|
| 286 | 280 | for(i = 0; i < len; i++) |
|
| 303 | 297 | static void |
|
| 304 | 298 | maprequest(XEvent *e) |
|
| 305 | 299 | { |
|
| 306 | - | XMapRequestEvent *ev = &e->xmaprequest; |
|
| 307 | 300 | static XWindowAttributes wa; |
|
| 301 | + | XMapRequestEvent *ev = &e->xmaprequest; |
|
| 308 | 302 | ||
| 309 | 303 | if(!XGetWindowAttributes(dpy, ev->window, &wa)) |
|
| 310 | 304 | return; |
|
| 322 | 316 | static void |
|
| 323 | 317 | propertynotify(XEvent *e) |
|
| 324 | 318 | { |
|
| 325 | - | XPropertyEvent *ev = &e->xproperty; |
|
| 326 | - | Window trans; |
|
| 327 | 319 | Client *c; |
|
| 320 | + | Window trans; |
|
| 321 | + | XPropertyEvent *ev = &e->xproperty; |
|
| 328 | 322 | ||
| 329 | 323 | if(ev->state == PropertyDelete) |
|
| 330 | 324 | return; /* ignore */ |
|
| 17 | 17 | ||
| 18 | 18 | /* static */ |
|
| 19 | 19 | ||
| 20 | - | static Bool otherwm; |
|
| 21 | 20 | static int (*xerrorxlib)(Display *, XErrorEvent *); |
|
| 21 | + | static Bool otherwm; |
|
| 22 | 22 | ||
| 23 | 23 | static void |
|
| 24 | 24 | cleanup() |
|
| 34 | 34 | scan() |
|
| 35 | 35 | { |
|
| 36 | 36 | unsigned int i, num; |
|
| 37 | - | Window *wins; |
|
| 37 | + | Window *wins, d1, d2; |
|
| 38 | 38 | XWindowAttributes wa; |
|
| 39 | - | Window d1, d2; |
|
| 40 | 39 | ||
| 41 | 40 | if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) { |
|
| 42 | 41 | for(i = 0; i < num; i++) { |
|
| 55 | 54 | static int |
|
| 56 | 55 | win_property(Window w, Atom a, Atom t, long l, unsigned char **prop) |
|
| 57 | 56 | { |
|
| 58 | - | Atom real; |
|
| 59 | - | int format; |
|
| 57 | + | int status, format; |
|
| 60 | 58 | unsigned long res, extra; |
|
| 61 | - | int status; |
|
| 59 | + | Atom real; |
|
| 62 | 60 | ||
| 63 | 61 | status = XGetWindowProperty(dpy, w, a, 0L, l, False, t, &real, &format, |
|
| 64 | 62 | &res, &extra, prop); |
|
| 101 | 99 | int |
|
| 102 | 100 | getproto(Window w) |
|
| 103 | 101 | { |
|
| 104 | - | unsigned char *protocols; |
|
| 105 | - | long res; |
|
| 106 | 102 | int protos = 0; |
|
| 107 | 103 | int i; |
|
| 104 | + | long res; |
|
| 105 | + | unsigned char *protocols; |
|
| 108 | 106 | ||
| 109 | 107 | res = win_property(w, wmatom[WMProtocols], XA_ATOM, 20L, &protocols); |
|
| 110 | 108 | if(res <= 0) { |
|
| 148 | 146 | xerror(Display *dpy, XErrorEvent *ee) |
|
| 149 | 147 | { |
|
| 150 | 148 | if(ee->error_code == BadWindow |
|
| 151 | - | || (ee->request_code == X_SetInputFocus |
|
| 152 | - | && ee->error_code == BadMatch) |
|
| 153 | - | || (ee->request_code == X_PolyText8 |
|
| 154 | - | && ee->error_code == BadDrawable) |
|
| 155 | - | || (ee->request_code == X_PolyFillRectangle |
|
| 156 | - | && ee->error_code == BadDrawable) |
|
| 157 | - | || (ee->request_code == X_PolySegment |
|
| 158 | - | && ee->error_code == BadDrawable) |
|
| 159 | - | || (ee->request_code == X_ConfigureWindow |
|
| 160 | - | && ee->error_code == BadMatch) |
|
| 161 | - | || (ee->request_code == X_GrabKey |
|
| 162 | - | && ee->error_code == BadAccess)) |
|
| 149 | + | || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch) |
|
| 150 | + | || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable) |
|
| 151 | + | || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable) |
|
| 152 | + | || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable) |
|
| 153 | + | || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch) |
|
| 154 | + | || (ee->request_code == X_GrabKey && ee->error_code == BadAccess)) |
|
| 163 | 155 | return 0; |
|
| 164 | 156 | fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", |
|
| 165 | - | ee->request_code, ee->error_code); |
|
| 157 | + | ee->request_code, ee->error_code); |
|
| 166 | 158 | return xerrorxlib(dpy, ee); /* may call exit() */ |
|
| 167 | 159 | } |
|
| 168 | 160 | ||
| 170 | 162 | main(int argc, char *argv[]) |
|
| 171 | 163 | { |
|
| 172 | 164 | int i, n; |
|
| 165 | + | unsigned int mask; |
|
| 173 | 166 | fd_set rd; |
|
| 174 | - | XSetWindowAttributes wa; |
|
| 175 | - | unsigned int mask; |
|
| 176 | 167 | Bool readstdin = True; |
|
| 177 | 168 | Window w; |
|
| 178 | 169 | XEvent ev; |
|
| 170 | + | XSetWindowAttributes wa; |
|
| 179 | 171 | ||
| 180 | 172 | for(i = 1; (i < argc) && (argv[i][0] == '-'); i++) { |
|
| 181 | 173 | switch (argv[i][1]) { |
|
| 254 | 246 | ||
| 255 | 247 | issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask); |
|
| 256 | 248 | ||
| 257 | - | wa.event_mask = SubstructureRedirectMask | EnterWindowMask \ |
|
| 258 | - | | LeaveWindowMask; |
|
| 249 | + | wa.event_mask = SubstructureRedirectMask | EnterWindowMask | LeaveWindowMask; |
|
| 259 | 250 | wa.cursor = cursor[CurNormal]; |
|
| 260 | - | ||
| 261 | 251 | XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa); |
|
| 262 | 252 | ||
| 263 | 253 | strcpy(stext, "dwm-"VERSION); |
|
| 264 | - | ||
| 265 | 254 | scan(); |
|
| 266 | 255 | ||
| 267 | 256 | /* main event loop, reads status text from stdin as well */ |
|
| 20 | 20 | ||
| 21 | 21 | /* CUSTOMIZE */ |
|
| 22 | 22 | static Rule rule[] = { |
|
| 23 | - | /* class instance tags isfloat */ |
|
| 24 | - | { "Firefox.*", { [Twww] = "www" }, False }, |
|
| 25 | - | { "Gimp.*", { 0 }, True}, |
|
| 23 | + | /* class:instance tags isfloat */ |
|
| 24 | + | { "Firefox.*", { [Twww] = "www" }, False }, |
|
| 25 | + | { "Gimp.*", { 0 }, True}, |
|
| 26 | 26 | }; |
|
| 27 | 27 | ||
| 28 | 28 | /* extern */ |
|
| 71 | 71 | void |
|
| 72 | 72 | dotile(Arg *arg) |
|
| 73 | 73 | { |
|
| 74 | - | Client *c; |
|
| 75 | 74 | int n, i, w, h; |
|
| 75 | + | Client *c; |
|
| 76 | 76 | ||
| 77 | 77 | w = sw - mw; |
|
| 78 | 78 | arrange = dotile; |
|
| 161 | 161 | replacetag(Arg *arg) |
|
| 162 | 162 | { |
|
| 163 | 163 | int i; |
|
| 164 | + | ||
| 164 | 165 | if(!sel) |
|
| 165 | 166 | return; |
|
| 166 | 167 | ||
| 26 | 26 | emallocz(unsigned int size) |
|
| 27 | 27 | { |
|
| 28 | 28 | void *res = calloc(1, size); |
|
| 29 | + | ||
| 29 | 30 | if(!res) |
|
| 30 | 31 | bad_malloc(size); |
|
| 31 | 32 | return res; |
|
| 34 | 35 | void |
|
| 35 | 36 | eprint(const char *errstr, ...) { |
|
| 36 | 37 | va_list ap; |
|
| 38 | + | ||
| 37 | 39 | va_start(ap, errstr); |
|
| 38 | 40 | vfprintf(stderr, errstr, ap); |
|
| 39 | 41 | va_end(ap); |
|
| 44 | 46 | spawn(Arg *arg) |
|
| 45 | 47 | { |
|
| 46 | 48 | char **argv = (char **)arg->argv; |
|
| 49 | + | ||
| 47 | 50 | if(!argv || !argv[0]) |
|
| 48 | 51 | return; |
|
| 49 | 52 | if(fork() == 0) { |
|