From 890382b8e06374979dbeb0e45541ac315237d551 Mon Sep 17 00:00:00 2001 From: Andrew Gaffney Date: Fri, 14 Nov 2008 10:14:23 -0600 Subject: [PATCH] Simplify implementation of parse_opt in linuxrc --- ChangeLog | 3 +++ defaults/initrd.scripts | 14 +------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f2468d..e011419 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ # Copyright 1999-2008 Gentoo Foundation; 2008 Chris Gianelloni, Andrew Gaffney # Distributed under the GPL v2 + 14 Nov 2008; Andrew Gaffney defaults/initrd.scripts: + Simplify implementation of parse_opt in linuxrc + 14 Nov 2008; Andrew Gaffney defaults/initrd.scripts, defaults/linuxrc: Small cleanups in unionfs code diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index d333767..0de1e1f 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -6,22 +6,10 @@ backup() { echo -ne "\033[0G\033[0K" } -strlen() { - if [ -z "$1" ] - then - echo "usage: strlen " - die - fi - eval echo "\${#${1}}" -} - parse_opt() { case "$1" in *\=*) - local key_name="`echo "$1" | cut -f1 -d=`" - local key_len=`strlen key_name` - local value_start=$((key_len+2)) - echo "$1" | cut -c ${value_start}- + echo "$1" | cut -d= -f2- ;; esac } -- 2.26.2