From ffce4bc35a34b6b543e2ae2828a3096a19ebb1ae Mon Sep 17 00:00:00 2001
From: Alexandre Rostovtsev <tetromino@gentoo.org>
Date: Tue, 28 Jul 2015 22:24:56 -0400
Subject: [PATCH] Avoid -n in "echo -n foo > /sys/bar"

It's not portable and not needed.

https://bugs.freedesktop.org/show_bug.cgi?id=91497

[ Rebased on top of Gentoo's -r6 patchset. ]
---
 pm/pm-functions.in | 8 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index c82be30..a68f955 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -296,13 +296,13 @@
 if [ -z "$SUSPEND_MODULE" ]; then
 	if grep -q mem /sys/power/state; then
 		SUSPEND_MODULE="kernel"
-		do_suspend() { echo -n "mem" >/sys/power/state; }
+		do_suspend() { echo "mem" >/sys/power/state; }
 	elif [ -c /dev/pmu ] && pm-pmu --check; then
 		SUSPEND_MODULE="kernel"
 		do_suspend() { pm-pmu --suspend; }
 	elif grep -q standby /sys/power/state; then
 		SUSPEND_MODULE="kernel"
-		do_suspend() { echo -n "standby" >/sys/power/state; }
+		do_suspend() { echo "standby" >/sys/power/state; }
 	fi
 fi
 
@@ -317,10 +317,10 @@
 		HIBERNATE_MODE_SAVE=$(cat /sys/power/disk) && \
 		HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE##*[}" && \
 		HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE%%]*}" && \
-		echo -n "${HIBERNATE_MODE}" > /sys/power/disk
-		echo -n "disk" > /sys/power/state
+		echo "${HIBERNATE_MODE}" > /sys/power/disk
+		echo "disk" > /sys/power/state
 		RET=$?
-		echo -n "$HIBERNATE_MODE_SAVE" > /sys/power/disk
+		echo "$HIBERNATE_MODE_SAVE" > /sys/power/disk
 		return "$RET"
 	}
 fi
-- 
2.4.6

