Menu

diff markup problems in 0.94

Help
tampere
2005-07-19
2013-01-02
  • tampere

    tampere - 2005-07-19

    Hi,

    "diff markup" funciton failed to make a proper diff. Its HTML output was simply listings of two files side by side. And the alignment is poor.

    I digged into the problem. and I found

        unless (open(DIFF, "-|")) {
            open(STDERR, ">&STDOUT");
            exec('diff', '-U0', $origtemp, $difftemp);
            print "*** Diff subprocess died unexpextedly: $!\n";
            exit;
        }

        my ($os, $ol, $ns, $nl, $ms, $ml, $bo, $ofs, $dir, %orig, %new, %chg);

    # I found <DIFF> is empty

        while (<DIFF>) {
            if (($os, $ol, $ns, $nl) = /@@ -(\d+)(?:,(\d+)|) \+(\d+)(?:,(\d+)|) @@/) { ##value is false
    # These codes are not executed
                $os++ if $ol eq '0';
                $ns++ if $nl eq '0';
                $ol = 1 unless defined($ol);

    Could some lxr or perl guru help?

     
    • tampere

      tampere - 2005-07-20

      <DIFF> does have some output. No ouput is due to that I compared two file which are the same.

      But then,  the coloumn view is ugly. They're not aligned properly.

       
    • tampere

      tampere - 2005-07-21

      Ok, i found out the cause of un-aligned display. It was because my source codes has dos-style new line.

       

Log in to post a comment.