summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax2017-03-28 19:42:52 -0400
committerMax2017-03-28 19:42:52 -0400
commit3c91aa1169c968f952879987690e63ee50fd3542 (patch)
tree7334747f411e93551b9575d7eada79442ada4d53
parentfb9ba19a0cea016fe62977a062af6e64f837148f (diff)
downloadaur-3c91aa1169c968f952879987690e63ee50fd3542.tar.gz
simplified arg handling
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD2
-rw-r--r--launch.c7
3 files changed, 3 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 90104cb49a1f..1959d7151c33 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = launch-cmd
pkgdesc = Launch an independent process from a shell
- pkgver = 1
+ pkgver = 1.0.1
pkgrel = 1
arch = any
license = GPL
diff --git a/PKGBUILD b/PKGBUILD
index 27feafb10934..1596583eb78a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
# Maintainer: Max <silverhammermba@gmail.com>
pkgname=launch-cmd
-pkgver=1
+pkgver=1.0.1
pkgrel=1
pkgdesc="Launch an independent process from a shell"
arch=('any')
diff --git a/launch.c b/launch.c
index 85bb1115384a..0e8973dd1715 100644
--- a/launch.c
+++ b/launch.c
@@ -21,17 +21,12 @@ int main(int argc, char** argv)
return 0;
}
- // swallow the leading arg and put a NULL at the end
- for (int i = 0; i < argc - 1; ++i)
- argv[i] = argv[i + 1];
- argv[argc - 1] = NULL;
-
// silence output
if (!freopen("/dev/null", "w", stdout)) fprintf(stdout, "Failed to silence stdout\n");
if (!freopen("/dev/null", "w", stderr)) fprintf(stderr, "Failed to silence stderr\n");
// run the command
- if (execvp(argv[0], argv))
+ if (execvp(argv[1], argv + 1))
{
if (freopen("/dev/tty", "w", stderr)) perror(argv[0]);
}