[PATCH weston 2/3] weston-launch: fix -t option parsing

Pekka Paalanen ppaalanen at gmail.com
Wed Nov 1 14:24:33 UTC 2017


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Fix an issue introduced in:

 commit ab4999492ce630e6bb1c93215fc052c2c29913bd
 Author: Kristian Høgsberg <krh at bitplanet.net>
 Date:   Fri Jul 19 21:26:24 2013 -0700

     weston-launch: Drop sleep_fork option

where the option string accidentally became "t::". That causes

	$ weston-lauch -t /dev/tty4

to be parsed incorrectly, as if -t option had no argument and the tty
path gets passed to weston which errors out because of it.

This patch fixes the above to work as expected.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 libweston/weston-launch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
index bc50de74..6a7a7649 100644
--- a/libweston/weston-launch.c
+++ b/libweston/weston-launch.c
@@ -698,7 +698,7 @@ main(int argc, char *argv[])
 
 	memset(&wl, 0, sizeof wl);
 
-	while ((c = getopt_long(argc, argv, "u:t::vh", opts, &i)) != -1) {
+	while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) {
 		switch (c) {
 		case 'u':
 			wl.new_user = optarg;
-- 
2.13.6



More information about the wayland-devel mailing list