--- loncom/interface/lonhtmlcommon.pm	2004/11/19 20:17:52	1.97
+++ loncom/interface/lonhtmlcommon.pm	2004/11/30 18:42:09	1.101
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.97 2004/11/19 20:17:52 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.101 2004/11/30 18:42:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -132,6 +132,9 @@ sub select_recent {
     foreach (sort keys %recent) {
 	unless ($_=~/^error\:/) {
 	    my $escaped = &Apache::loncommon::escape_url($_);
+            if ($_ =~ /\/$/ && $escaped !~ /\/$/) {
+                $escaped .= '/';
+            }
 	    $return.="\n<option value='$escaped'>".
 		&Apache::lonnet::unescape((split(/\&/,$recent{$_}))[1]).
 		'</option>';
@@ -899,23 +902,25 @@ sub crumbs {
     if (! defined($size)) {
         $size = '+2';
     }
+    if ($target) {
+        $target = ' target="'.
+                  &Apache::loncommon::escape_single($target).'"';
+    }
     my $output='';
     unless ($noformat) { $output.='<br /><tt><b>'; }
     $output.='<font size="'.$size.'">'.$prefix.'/';
     if ($ENV{'user.adv'}) {
 	my $path=$prefix.'/';
-	foreach (split('/',$uri)) {
-	    unless ($_) { next; }
-	    $path.=$_;
+	foreach my $dir (split('/',$uri)) {
+            if (! $dir) { next; }
+            $path .= $dir;
 	    unless ($path eq $uri) { $path.='/'; }
-	    my $linkpath=$path;
-	    if ($form) {
-		my $escaped_path = &Apache::loncommon::escape_single($path);
-		$linkpath="javascript:$form.action='$escaped_path';$form.submit();";
-	    }
-	    my $escaped_linkpath = &Apache::loncommon::escape_single($linkpath);
-	    my $escaped_target   = &Apache::loncommon::escape_single($target);
-	    $output.='<a href="'.$escaped_linkpath.'"'.($target?' target="'.$escaped_target.'"':'').'>'.$_.'</a>/';
+            my $linkpath = &Apache::loncommon::escape_single($path);
+            if ($form) {
+		$linkpath=
+                    qq{javascript:$form.action='$linkpath';$form.submit();};
+            }
+	    $output.=qq{<a href="$linkpath" $target>$dir</a>/};
 	}
     } else {
 	$output.=$uri;