#75 Highlighting error on path with dot and no file extension

closed-fixed
nobody
None
5
2008-07-22
2008-07-16
rob_webset
No

Hi David,

We've found a strange one. When viewing a code review we get the following error:

Software error:
Error in tempfile() using C:\temp\XXXXXXXXXX.1/text/swinstall: Parent directory (C:\temp\H0NkHr14xm.1/text/) is not a directory at C:/Apps/codestriker/bin/../lib/Codestriker/Http/HighlightLineFilter.pm line 38

The cause of this is that the filename has no extension, and there is actually a dot in the path, the filename in question was:

branches/01795_ALL_10.6.1/text/swinstall

I've put a fix in locally for this which is in file Http/HighlightLineFilter.pm, function filter adding an if round the last two lines:

if( ! ($extension =~ /\//) ) {
$delta->{diff_old_lines} = $self->_filter($delta->{diff_old_lines}, $extension);
$delta->{diff_new_lines} = $self->_filter($delta->{diff_new_lines}, $extension);
}

There is most probably a better solution but this is what I added in order to get the system up and running again.

Thanks

Rob

Discussion

  • David Sitsky
    David Sitsky
    2008-07-17

    Logged In: YES
    user_id=208928
    Originator: NO

    Hi Rob,

    Can you try this change instead and let me know if that fixes it? Thanks.

    From this:

    if ($delta->{filename} =~ /^.*(\..*),v$/o || $delta->{filename} =~ /^.*(\..*)$/o) {

    to this?

    if ($delta->{filename} =~ /^.*(\.[^\/\\]*),v$/o || $delta->{filename} =~ /^.*(\.[^\/\\]*)$/o) {

     
  • rob_webset
    rob_webset
    2008-07-17

    Logged In: YES
    user_id=1137102
    Originator: YES

    That change works great - thanks

    Rob

     
  • David Sitsky
    David Sitsky
    2008-07-22

    • status: open --> closed-fixed
     
  • David Sitsky
    David Sitsky
    2008-07-22

    Logged In: YES
    user_id=208928
    Originator: NO

    Thanks - has now been committed.