mavak / trucov

True coverage tool for C / C++
1 stars 1 forks source link

Get Relative Path Function Crashing! #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

millerlyte87@millerlyte87-laptop:~/trucov$ ./trucov render
--chdir=sample_test/fast_protocol/
************ EXECUTING IN DEBUG MODE ************
This is render
tru_utility::ERROR::Length Error

It's this piece of code causing it in tru_utility.cpp

Function: get_rel_path(string path) line: 121

   //length of input string must be less than or equal to the cwd
   if(path.length() <= tmp_str.length())
   {
      //print error message
      cout << "tru_utility::ERROR::Length Error\n";

      //return empty string
      return "";
   }

A path should be able to be less than the cwd.
Example:
 path = /home/matt/
 cwd = /home/matt/fish/dog

 Then relative path = ../../

This is critical, because it prevents the render command from working.

Original issue reported on code.google.com by millerlyte87@gmail.com on 21 Aug 2009 at 3:07

GoogleCodeExporter commented 9 years ago
A path should also be able to be the same length:

Example:
 path = /home/matt/cat
 cwd  = /home/matt/dog

 Then relative path = ../cat

Original comment by millerlyte87@gmail.com on 21 Aug 2009 at 3:10

GoogleCodeExporter commented 9 years ago

Original comment by yekyaw.wsu@gmail.com on 21 Aug 2009 at 6:58

GoogleCodeExporter commented 9 years ago
I think you forgot to commit this to the svn.

Original comment by millerlyte87@gmail.com on 22 Aug 2009 at 12:30

GoogleCodeExporter commented 9 years ago

Original comment by yekyaw.wsu@gmail.com on 22 Aug 2009 at 4:25

GoogleCodeExporter commented 9 years ago
Verified by Matt

Original comment by millerlyte87@gmail.com on 4 Sep 2009 at 10:41