From: Don Armstrong Date: Tue, 13 Jan 2015 05:00:14 +0000 (-0800) Subject: handle git files which are in "" (for utf-8 characters in the filename) X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=11002400952e5341adc9ded20caa016cbb599d1c;p=bin.git handle git files which are in "" (for utf-8 characters in the filename) --- diff --git a/bibtex_to_paper b/bibtex_to_paper index f7ba6cc..8de1f19 100755 --- a/bibtex_to_paper +++ b/bibtex_to_paper @@ -190,8 +190,9 @@ sub load_papers_into_database { my @dirs = ref($dir)?@{$dir}:$dir; if ($options{use_git}) { - my @files = grep /\.pdf$/, split /\n/, qx(git ls-tree HEAD -r --full-name --name-only); + my @files = grep /\.pdf\"?$/, split /\n/, qx(git ls-tree HEAD -r --full-name --name-only); for my $file (@files) { + $file =~ s/^\"(.+)\"$/"qq($1)"/gee; insert_or_replace_papers($dbh,$sth,basename($file),File::Spec->rel2abs($file), -e "${file}.xoj"); } } else {