/[jscoverage]/trunk/util.c
ViewVC logotype

Diff of /trunk/util.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 449 by siliconforks, Tue Aug 11 17:23:20 2009 UTC revision 450 by siliconforks, Tue Aug 11 18:39:03 2009 UTC
# Line 281  Line 281 
281  char * make_path(const char * parent, const char * relative_path) {  char * make_path(const char * parent, const char * relative_path) {
282    size_t parent_length = strlen(parent);    size_t parent_length = strlen(parent);
283    size_t relative_path_length = strlen(relative_path);    size_t relative_path_length = strlen(relative_path);
   assert(parent_length > 0);  
   assert(relative_path_length > 0);  
284    size_t result_length = addst(parent_length, relative_path_length);    size_t result_length = addst(parent_length, relative_path_length);
285    int parent_ends_with_slash = is_slash(parent[parent_length - 1]);    int parent_ends_with_slash = parent_length > 0 && is_slash(parent[parent_length - 1]);
286    if (parent_ends_with_slash) {    if (parent_ends_with_slash) {
287      result_length = addst(result_length, 1);      result_length = addst(result_length, 1);
288    }    }

Legend:
Removed from v.449  
changed lines
  Added in v.450

  ViewVC Help
Powered by ViewVC 1.1.24