]> andersk Git - splint.git/blobdiff - src/osd.c
Merged this branch with the one in the splint.sf.net repository.
[splint.git] / src / osd.c
index a78861f59e99b1ec91beff48015b79e7c918edfc..6a0fea6f6d0b0483140b6503225be43434c34ef0 100644 (file)
--- a/src/osd.c
+++ b/src/osd.c
@@ -1033,7 +1033,6 @@ cstring osd_absolutePath (cstring cwd, cstring filename)
 
 cstring osd_outputPath (cstring filename)
 {
-  /*@i2534 fix this junky code once and for all! */
 # if defined (UNIX) || defined (OS2)
   char *rel_buffer;
   char *rel_buf_p;
@@ -1065,16 +1064,21 @@ cstring osd_outputPath (cstring filename)
       else
        {
          /*@i324 ! splint didn't report an errors for: return ++path_p; */
-         return cstring_fromCharsNew (path_p + 1);
+         return cstring_fromCharsNew (++path_p);
        }
     }
   else
     {
+
+      /* drl   2002-04-14 I had to put this code back*/
+      /* the case that needs it is when splint is given an absolute path name of a file outside of the current directory and the subdirectories below the current directory. e.g. cd /home/; splint /tmp/prog.c
+       */
+      
       /* evans 2002-02-05 This is horrible code, which I've removed.  I couldn't find any
       ** test cases that need it, so I hope I'm not breaking anything.
       */
 
-# if 0      
+
       if (*path_p != '\0')
         {
           --cwd_p;
@@ -1091,7 +1095,7 @@ cstring osd_outputPath (cstring filename)
 
       /* Find out how many directory levels in cwd were *not* matched.  */
       while (*cwd_p != '\0')
-       {s
+       {
          if (osd_isConnectChar (*cwd_p++))
            unmatched_slash_count++;
        }
@@ -1102,7 +1106,8 @@ cstring osd_outputPath (cstring filename)
        {
          return cstring_copy (filename);
        }
-# endif
+
+      /*drl 04-14-2002 end previously removed code */
       
       /* For each of them, put a `../' at the beginning of the short name.  */
       while (unmatched_slash_count-- > 0)
@@ -1131,7 +1136,6 @@ cstring osd_outputPath (cstring filename)
         } /*@-usereleased@*/
       while ((*rel_buf_p++ = *path_p++) != '\0') ;
 
-      
       /*@=usereleased@*/ /*@i523! shouldn't need these */
       --rel_buf_p;
 
This page took 0.155318 seconds and 4 git commands to generate.