Fix uninitialized value when editing a page being vivified from the
basewiki. Makes the filetype-testing logic more explicit anyway.master
parent
c36d2fa896
commit
e972cadf78
|
@ -226,13 +226,18 @@ sub rcs_add ($) {
|
||||||
}
|
}
|
||||||
|
|
||||||
while ($file = pop @files_to_add) {
|
while ($file = pop @files_to_add) {
|
||||||
if ((@files_to_add == 0) &&
|
if (@files_to_add == 0) {
|
||||||
(File::MimeInfo::default $file ne 'text/plain')) {
|
# file
|
||||||
# it's a binary file, add specially
|
my $filemime = File::MimeInfo::default($file);
|
||||||
cvs_runcvs(['add', '-kb', $file]) ||
|
if (defined($filemime) && $filemime eq 'text/plain') {
|
||||||
warn("cvs add $file failed\n");
|
cvs_runcvs(['add', $file]) ||
|
||||||
|
warn("cvs add $file failed\n");
|
||||||
|
} else {
|
||||||
|
cvs_runcvs(['add', '-kb', $file]) ||
|
||||||
|
warn("cvs add binary $file failed\n");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
# directory or regular file
|
# directory
|
||||||
cvs_runcvs(['add', $file]) ||
|
cvs_runcvs(['add', $file]) ||
|
||||||
warn("cvs add $file failed\n");
|
warn("cvs add $file failed\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue