Skip to content

Commit

Permalink
smart devouring, no more safe vs unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
salman-abedin committed Aug 26, 2020
1 parent 32b23f4 commit 1480b19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ git clone https://github.com/salman-abedin/devour.git && cd devour && sudo make
## Usage

```sh
devour CMD ... SAFE FILE ...
devour CMD ... -- SAFE FILE/UNSAFE FILE
devour CMD ...
```

## Patches
Expand Down
7 changes: 1 addition & 6 deletions devour.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@
#include <string.h>

void run_command(char** argv) {
int is_safe = 1;
char cmd[512] = {0};

while (*++argv) {
if (!strcmp(*argv, "--")) {
is_safe = 0;
continue;
}
if (is_safe) {
if (!strstr(*argv, " ")) {
strcat(cmd, *argv);
} else {
while (**argv) {
Expand Down

0 comments on commit 1480b19

Please sign in to comment.