about summary refs log tree commit diff
path: root/Src/mkmodindex.sh
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-16 14:26:16 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-16 14:26:16 +0000
commit02c0df21747e5795197510f15da73bd0c287e978 (patch)
treecb14653880f6e9aed25c179c7dbc301f287e9242 /Src/mkmodindex.sh
parent77d48c89e05417ef40abc917ec7e2713779f8951 (diff)
downloadzsh-02c0df21747e5795197510f15da73bd0c287e978.tar.gz
zsh-02c0df21747e5795197510f15da73bd0c287e978.tar.xz
zsh-02c0df21747e5795197510f15da73bd0c287e978.zip
manual/9083
Diffstat (limited to 'Src/mkmodindex.sh')
-rw-r--r--Src/mkmodindex.sh39
1 files changed, 18 insertions, 21 deletions
diff --git a/Src/mkmodindex.sh b/Src/mkmodindex.sh
index b4616f638..75a7e43bc 100644
--- a/Src/mkmodindex.sh
+++ b/Src/mkmodindex.sh
@@ -13,28 +13,25 @@ while test $# -ne 0; do
     dir=$1
     shift
     ( set $dir/*.mdd; test -f $1 ) || continue
-    dosubs=false
-    for mod in `echo '' $dir/*.mdd '' | sed 's, [^ ]*/, ,g;s,\.mdd , ,g'`; do
-	case `echo "$mod@ $module_list " | sed 's,^.*[^_0-9A-Za-z].*@,@@,'` in
-	    @@*)
-		echo >&2 "WARNING: illegally named module \`$mod' in $dir"
-		echo >&2 "         (ignoring it)"
-		;;
-	    *@*" $mod "*)
-		eval "loc=\$loc_$mod"
-		echo >&2 "WARNING: module \`$mod' (in $loc) duplicated in $dir"
-		echo >&2 "         (ignoring duplicate)"
-		dosubs=true
-		;;
-	    *)
-		module_list="$module_list$mod "
-		echo "loc_$mod=$dir"
-		eval "loc_$mod=\$dir"
-		dosubs=true
-		;;
-	esac
+    for modfile in $dir/*.mdd; do
+	name=`( . $modfile; echo $name )`
+	case "$name" in *[!/_0-9A-Za-z]* | /* | */ | *//*)
+	    echo >&2 "WARNING: illegally named module \`$name' in $modfile"
+	    echo >&2 "         (ignoring it)"
+	    continue
+	;; esac
+	q_name=`echo $name | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`
+	case " $module_list " in *" $name "*)
+	    eval "omodfile=\$modfile_$q_name"
+	    echo >&2 "WARNING: module \`$name' (in $omodfile) duplicated in $modfile"
+	    echo >&2 "         (ignoring duplicate)"
+	    continue
+	;; esac
+	module_list="$module_list$name "
+	echo "modfile_$q_name=$modfile"
+	eval "modfile_$q_name=\$modfile"
     done
-    $dosubs && set `echo $dir/*/. '' | sed 's,/\. , ,g'` "$@"
+    set `echo $dir/*/. '' | sed 's,/\. , ,g'` "$@"
 done
 
 echo