From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: olddoc-public@80x24.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 042F6633843; Fri, 30 Oct 2015 19:46:35 +0000 (UTC) From: Eric Wong To: olddoc-public@80x24.org Cc: Eric Wong Subject: [PATCH] oldweb: fix relative path normalization Date: Fri, 30 Oct 2015 19:46:33 +0000 Message-Id: <20151030194633.7430-1-e@80x24.org> List-Id: We must explicitly convert Pathname to string before comparing against '.' to prevent ugly './' prefixes in relative paths from showing up. --- lib/oldweb.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oldweb.rb b/lib/oldweb.rb index d045693..12ce876 100644 --- a/lib/oldweb.rb +++ b/lib/oldweb.rb @@ -92,7 +92,7 @@ class Oldweb def rel_path(out_file) rel_prefix = @outputdir.relative_path_from(out_file.dirname) - rel_prefix == '.' ? '' : "#{rel_prefix}/" + rel_prefix.to_s == '.' ? '' : "#{rel_prefix}/" end # called standalone by servelet -- EW