diff options
-rwxr-xr-x | .ci/build.sh | 16 | ||||
-rw-r--r-- | .travis.yml | 13 | ||||
-rw-r--r-- | sway/commands.c | 11 |
3 files changed, 10 insertions, 30 deletions
diff --git a/.ci/build.sh b/.ci/build.sh deleted file mode 100755 index ece5b2a3..00000000 --- a/.ci/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# clone and build wlc -git clone https://github.com/Cloudef/wlc.git -cd wlc -git submodule update --init --recursive # - initialize and fetch submodules -mkdir target && cd target # - create build target directory -cmake -DCMAKE_BUILD_TYPE=Upstream .. # - run CMake -make # - compile -sudo make install # - install - -cd ../.. - -# build sway -cmake . -make diff --git a/.travis.yml b/.travis.yml index ad746552..a8e292ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,23 +11,16 @@ arch: - cmake - xorg-server-xwayland - asciidoc - - pcre - json-c - - pixman - wayland - - libxkbcommon - - libinput - - libx11 - - libxcb - xcb-util-image - - libgl - - mesa - pango - cairo - gdk-pixbuf2 - - xcb-util-wm + - wlc-git script: - - "bash .ci/build.sh" + - "cmake ." + - "make" script: - "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash" diff --git a/sway/commands.c b/sway/commands.c index f6326038..9f6e5032 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -169,15 +169,18 @@ static struct cmd_results *cmd_assign(int argc, char **argv) { char *criteria = *argv++; - if (strncmp(*argv, "→", 1) == 0) { + if (strncmp(*argv, "→", strlen("→")) == 0) { + if (argc < 3) { + return cmd_results_new(CMD_INVALID, "assign", "Missing workspace"); + } argv++; } char *movecmd = "move container to workspace "; - int arglen = strlen(*argv); - char *cmdlist = calloc(1, sizeof(movecmd) + arglen); + int arglen = strlen(movecmd) + strlen(*argv) + 1; + char *cmdlist = calloc(1, arglen); - sprintf(cmdlist, "%s%s", movecmd, *argv); + snprintf(cmdlist, arglen, "%s%s", movecmd, *argv); struct criteria *crit = malloc(sizeof(struct criteria)); crit->crit_raw = strdup(criteria); |