[hackers] [wmii] Add -K flag to wimenu. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Thu, 14 May 2009 03:43:54 +0000 (UTC)

changeset: 2447:06cbf1f654d4
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Wed May 13 23:43:54 2009 -0400
files: cmd/menu/main.c
description:
Add -K flag to wimenu.

diff -r 2e61304eec5f -r 06cbf1f654d4 cmd/menu/main.c
--- a/cmd/menu/main.c Wed May 13 23:30:20 2009 -0400
+++ b/cmd/menu/main.c Wed May 13 23:43:54 2009 -0400
@@ -194,9 +194,10 @@
 int
 main(int argc, char *argv[]) {
         Item *item;
- char *address;
- char *histfile;
- char *keyfile;
+ static char *address;
+ static char *histfile;
+ static char *keyfile;
+ static bool nokeys;
         int i;
         long ndump;
         int screen;
@@ -204,8 +205,6 @@
         quotefmtinstall();
         fmtinstall('r', errfmt);
         address = getenv("WMII_ADDRESS");
- histfile = nil;
- keyfile = nil;
         screen = PointerScreen;
 
         find = strstr;
@@ -223,6 +222,8 @@
         case 'h':
                 histfile = EARGF(usage());
                 break;
+ case 'K':
+ nokeys = true;
         case 'k':
                 keyfile = EARGF(usage());
                 break;
@@ -271,7 +272,8 @@
         caret_insert("", true);
         update_filter();
 
- parse_keys(binding_spec);
+ if(!nokeys)
+ parse_keys(binding_spec);
         if(keyfile) {
                 i = open(keyfile, O_RDONLY);
                 if(read(i, buffer, sizeof(buffer)) > 0)
Received on Thu May 14 2009 - 03:43:54 UTC

This archive was generated by hypermail 2.2.0 : Thu May 14 2009 - 03:48:03 UTC