Commit 722b5b6
Topic silence warnings (jordansissel#364)
* xdotool.1: Fix rendering of example commands
italic does not work in verbatim paragraphs, remove it:
sed -i -e 's/^\( *.*\)I</\1</g' xdotool.pod
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Error out on allocation failure
.. when allocating space for tokens while parsing.
The array allocation was checked already, also check that allocating
memory for the content works out fine.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Fix tokenizing a single-line command chain
I was getting 'Unknown command: <garbage-on-stack>' for a sequence of
commands that containted no newline:
echo -n "several commands and args here" | xdotool -
fgets null-terminates the buffer, but we were tokenizing past the end of
the read line in the while-loop since we skipped the _final_ zero byte.
There was another bug when tokenizing the commandline arguments when
one token spans more than one buffer, the token was seen as two arguments,
cut in half mid-word where the previous buffer ended and the new buffer
started. E.g.: printf "mousemove%-4083s--polar -- 0 0" " "
complained that "Unknown command: olar".
Another incarnation of the same bug could be observed if you fed a token
into script_main that was longer than the buffer size: It was split on
the buffer boundary, making several tokens out of the single token given
by the user. E.g.:
perl -le 'print(("X"x 9000))' > input-9000
or
python3 -c 'print("X" * 9000)' > input-9000
and looking at the script argv when cat input-9000 | xdotool -
Or printf "mousemove%4107s" "--polar -- 0 0 sleep 0.1" > /tmp/i
(cat /tmp/i;echo " sleep 4";echo mousemove --polar -- 30 30) | ./xdotool -
Fix this by correctly handling tokens that cross buffers.
Diagnose allocation failures while at it.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* fix memory leak in mousemove, mousedown
window_arg was strdup()ed but not freed, fix that.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Remove superfluous guards around free(NULL)
SUS specifies that free(NULL) is perfectly valid (a noop).
Remove superfluous guards.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* window_is_valid(): make static
This is a private helper-function of window_get_arg() and not used
anywhere else.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* context_execute(): Move prototype to xdo_cmd.h
and remove now redundant declarations.
A single declaration avoids the risk of diverging scattered
declarations.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* xdotool: Remove redundant declarations
These live in xdo_cmd.h so are redundant in xdotool.c
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* getwindowclassname: silence warning
1) warning: no previous prototype for ‘xdo_get_window_classname’
2) warning: pointer targets in assignment from ‘char *’ to ‘unsigned char *’ differ in signedness
for classhint.res_class
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>1 parent ac8e2f2 commit 722b5b6
File tree
12 files changed
+136
-109
lines changed12 files changed
+136
-109
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
308 | | - | |
309 | | - | |
| 307 | + | |
310 | 308 | | |
311 | 309 | | |
312 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 119 | + | |
122 | 120 | | |
123 | 121 | | |
124 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 75 | + | |
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
| 193 | + | |
196 | 194 | | |
197 | 195 | | |
198 | 196 | | |
| |||
214 | 212 | | |
215 | 213 | | |
216 | 214 | | |
217 | | - | |
218 | | - | |
219 | | - | |
| 215 | + | |
220 | 216 | | |
221 | 217 | | |
222 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 163 | + | |
| 164 | + | |
167 | 165 | | |
168 | 166 | | |
169 | 167 | | |
| |||
1038 | 1036 | | |
1039 | 1037 | | |
1040 | 1038 | | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
| 1039 | + | |
1044 | 1040 | | |
1045 | 1041 | | |
1046 | 1042 | | |
| |||
1936 | 1932 | | |
1937 | 1933 | | |
1938 | 1934 | | |
1939 | | - | |
| 1935 | + | |
1940 | 1936 | | |
1941 | | - | |
1942 | | - | |
1943 | | - | |
1944 | | - | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
1945 | 1945 | | |
1946 | 1946 | | |
1947 | 1947 | | |
| |||
2058 | 2058 | | |
2059 | 2059 | | |
2060 | 2060 | | |
2061 | | - | |
| 2061 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
621 | 628 | | |
622 | 629 | | |
623 | 630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
0 commit comments