summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-11-20 07:53:20 +0000
committersabetts <sabetts>2004-11-20 07:53:20 +0000
commit8d9a70922f079696e33ca3eda9d34cb4c5efaaa1 (patch)
tree1918f20783ad3a812234283e94d02aa615fd32d8
parent968499469167c972d607f64373352dad7a9d5894 (diff)
downloadratpoison-8d9a70922f079696e33ca3eda9d34cb4c5efaaa1.zip
(cmd_rathold): change argument order. echo parse
errors.
-rw-r--r--ChangeLog8
-rw-r--r--src/actions.c24
2 files changed, 24 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 0849b0e..0beef7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
+2004-11-20 Shawn Betts <katia_dilkina@verizon.net>
+
+ * src/actions.c (cmd_rathold): change argument order. echo parse
+ errors.
+
2004-11-19 Shawn Betts <katia_dilkina@verizon.net>
+ * src/actions.c (cmd_sfdump): properly declare i at the top of the
+ function.
+
* src/frame.c (frame_dump): dump the frame as an sexpr instead of
a list of numbers.
(frame_read): read the new frame dump format
diff --git a/src/actions.c b/src/actions.c
index 84148b7..67e24d2 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -2043,15 +2043,23 @@ cmd_rathold (int interactive, char *data)
if (data != NULL)
{
- char *tmp;
- tmp = strtok(data, " ");
- command = strtok(NULL, "");
- if (!tmp || !command)
+ char *tmp, *tail;
+ command = strtok(data, " ");
+ tmp = strtok(NULL, " ");
+ if (!command)
{
- message ("rathold: invalid argument");
+ message (" rathold: Needs at least 1 argument. ");
return NULL;
}
- button = strtol(tmp, NULL, 10);
+ if (tmp)
+ {
+ button = strtol(tmp, &tail, 10);
+ if (*tail != '\0')
+ {
+ marked_message_printf (0, 0, " rathold: %s not a number. ", tmp);
+ return NULL;
+ }
+ }
}
else
{
@@ -2059,7 +2067,6 @@ cmd_rathold (int interactive, char *data)
return NULL;
}
-
if (!strcmp(command, "down"))
XTestFakeButtonEvent(dpy, button, True, CurrentTime);
else if(!strcmp(command,"up"))
@@ -4599,10 +4606,11 @@ cmd_sfdump (int interactively, char *data)
struct sbuf *s;
char *tmp, *tmp2;
rp_frame *cur;
+ int i;
s = sbuf_new (0);
- register int i;
+
for (i=0; i<num_screens; i++)
{
tmp2 = xsprintf (" %d,", (rp_have_xinerama)?(screens[i].xine_screen_num):(screens[i].screen_num));