config-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/4] Rewrite basic_machine `if` with `case`


From: John Ericson
Subject: [PATCH 1/4] Rewrite basic_machine `if` with `case`
Date: Sat, 21 Apr 2018 22:01:26 -0400

OK the last email didn't contain the [PATCH] and attatchments instead,
which may be less convenient. Also, with my armv6m patch merged
(thanks!) there are some trivial conflicts and I realized I forgot to
include any change log entries (which you kindly added for that). So I
am now resubmitting a rebased version with change log entries.

Hope this is more convenient,

John

--
This hopefully makes the condition more readable
---
 config.sub | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/config.sub b/config.sub
index ba37cf9..ca94006 100755
--- a/config.sub
+++ b/config.sub
@@ -128,9 +128,14 @@ case $maybe_os in
     ;;
   *)
     basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
-    if [ "$basic_machine" != "$1" ]
-    then os=`echo "$1" | sed 's/.*-/-/'`
-    else os=; fi
+    case $1 in
+      *-*)
+        os=`echo "$1" | sed 's/.*-/-/'`
+        ;;
+      *)
+        os=
+        ;;
+    esac
     ;;
 esac
 
-- 
2.16.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]