diff options
author | Amitai Schlair <schmonz@magnetic-babysitter.(none)> | 2009-08-30 13:49:38 -0400 |
---|---|---|
committer | Amitai Schlair <schmonz@magnetic-babysitter.(none)> | 2009-08-30 13:49:38 -0400 |
commit | e972cadf78ba511af33ba19d40c5b6156569120d (patch) | |
tree | de6d9e15b943b931479c295657c354e9fb2939b3 /IkiWiki | |
parent | c36d2fa896e9ea42c0b6b0135ba04b4f4f60950f (diff) | |
download | ikiwiki-e972cadf78ba511af33ba19d40c5b6156569120d.tar ikiwiki-e972cadf78ba511af33ba19d40c5b6156569120d.tar.gz |
Fix uninitialized value when editing a page being vivified from the
basewiki. Makes the filetype-testing logic more explicit anyway.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/cvs.pm | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm index 66e9463be..fa4c4da8e 100644 --- a/IkiWiki/Plugin/cvs.pm +++ b/IkiWiki/Plugin/cvs.pm @@ -226,13 +226,18 @@ sub rcs_add ($) { } while ($file = pop @files_to_add) { - if ((@files_to_add == 0) && - (File::MimeInfo::default $file ne 'text/plain')) { - # it's a binary file, add specially - cvs_runcvs(['add', '-kb', $file]) || - warn("cvs add $file failed\n"); + if (@files_to_add == 0) { + # file + my $filemime = File::MimeInfo::default($file); + if (defined($filemime) && $filemime eq 'text/plain') { + cvs_runcvs(['add', $file]) || + warn("cvs add $file failed\n"); + } else { + cvs_runcvs(['add', '-kb', $file]) || + warn("cvs add binary $file failed\n"); + } } else { - # directory or regular file + # directory cvs_runcvs(['add', $file]) || warn("cvs add $file failed\n"); } |