Commit Graph

22 Commits

Author SHA1 Message Date
Matt Coffin
2b5bf78faf Fix segfaults caused by faulty command parsing
This patch fixes faulty command parsing introduced by
f0f5de9a9e. When that commit allowed
criteria reset on ';' delimeters in commands lists, it failed to account
for its inner ','-parsing loop eating threw the entire rest of the
string.

This patch refactors argsep to use a list of multiple separators, and
(optionally) return the separator that it matched against in this
iteration via a pointer. This allows it to hint at the command parser
which separator was used at the end of the last command, allowing it to
trigger a potential secondary read of the criteria.

Fixes #4239
2019-06-11 14:40:36 -04:00
Ian Fan
5c8424c074 stringop.c: remove unused functions
The only use of `join_list` in swaybar/tray/icon.c has been rewritten.
2019-03-11 14:42:58 +01:00
Ian Fan
967566e37f stringop.c: rewrite strip_whitespace 2019-01-01 09:01:24 +00:00
Ian Fan
98c1e19466 list.c: rename free_flat_list to list_free_items_and_destroy 2018-12-09 01:15:38 +00:00
Ian Fan
19e831ed3d list.c: Remove list_foreach
Most occurrences have been replaced by `free_flat_list` which has been
moved from stringop.c to list.c. The rest have been replaced by for loops.
2018-12-09 00:37:50 +00:00
emersion
2afd930914
Use #if instead of #ifdef for WLR_HAS_* 2018-11-12 22:23:06 +01:00
Ryan Dwyer
7e81e58e7d Allow reload command to exist anywhere in the command string
This fixes a crash if you have commands where reload appears in the
middle or at the end, such as `bindsym r mode default, reload`.
2018-09-01 11:45:48 +10:00
Ryan Dwyer
db38b9bbf3 Clean up container title functions
* Add and use lenient_strcat and lenient_strncat functions
* Rename `concatenate_child_titles` function as that's no longer what it
does
* Rename `container_notify_child_title_changed` because we only need to
notify that the tree structure has changed, not titles
* Don't notify parents when a child changes its title
* Update ancestor titles when changing a container's layout
	* Eg. create nested tabs and change the inner container to stacking
* No need to store tree presentation in both container->name and
formatted_title
2018-05-25 21:07:59 +10:00
Mikkel Oscar Lyderik
32ae26e519 Add quotes to multiword arguments.
This adds quotes around multiword arguments before they are passed to
`/bin/sh -c` in an exec command.

Example:

I connect to irc like this:

    exec termite -e "mosh server tmux a"

Without this patch the arguments are passed to sh as:

    termite -e mosh server tmux a

When it should be:

    termite -e "mosh server tmux a"

For the command to work.
2016-01-25 00:14:13 +01:00
S. Christoffer Eliesen
d0af224e6d stringop: lenient_strcmp: Add. 2015-11-21 22:22:09 +01:00
Drew DeVault
c43ef2aedd We don't need to implement strdup
After defining _GNU_SOURCE
2015-11-12 19:43:03 -05:00
taiyu
0d51f62224 merge + no c_extensions 2015-09-18 07:23:04 -07:00
Drew DeVault
318e1be240 Fix warnings introduced by prior commit 2015-09-18 07:27:35 -04:00
taiyu
0bea2e2122 multi command keybinds 2015-09-14 19:59:25 -07:00
Drew DeVault
e505abfe75 Revert "new_workspace null behavior + testmap functions + regex"
This reverts commit e1d18e42a8.

Fixes #180

cc @taiyu-len
2015-09-13 19:46:16 -04:00
taiyu
e1d18e42a8 new_workspace null behavior + testmap functions + regex 2015-09-12 02:38:03 -07:00
taiyu
71af5b7dde config modes 2015-09-07 14:29:40 -07:00
taiyu
c8415d7fef split_string memory leaks cleanedup 2015-08-23 19:09:18 -07:00
minus
754793aad4 added IPC messages get_workspaces and get_outputs
No escaping on container names is done yet, as well as some values are
hardcoded because they don't exist yet.
2015-08-20 21:13:01 +02:00
Drew DeVault
85a573dab7 Revert "enhanced whitespace remover"
This reverts commit abd0afb03a.
2015-08-18 08:39:26 -04:00
taiyu
abd0afb03a enhanced whitespace remover 2015-08-18 03:22:31 -07:00
Drew DeVault
7f8ebb7d0d Move headers to include/ 2015-08-16 11:02:56 -04:00