]> andersk Git - splint.git/blobdiff - src/osd.c
Fixed some /@*i@*/ comments in the code.
[splint.git] / src / osd.c
index 3d75cf64ea2ba65085664ac4049da2373be931b3..24dcbf4d835eb30ceb8cf9c90f7a0a0d958eccb0 100644 (file)
--- a/src/osd.c
+++ b/src/osd.c
@@ -1,6 +1,6 @@
 /*
 ** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2002 University of Virginia,
+** Copyright (C) 1994-2003 University of Virginia,
 **         Massachusetts Institute of Technology
 **
 ** This program is free software; you can redistribute it and/or modify it
@@ -868,6 +868,7 @@ static void osd_setWorkingDirectory (void)
     {
       lldiagmsg (message ("Cannot get working directory: %s\n",
                          lldecodeerror (errno)));
+      osd_cwd = cstring_makeLiteral ("<missing directory>");
     }
   else
     {
@@ -903,7 +904,7 @@ cstring osd_absolutePath (cstring cwd, cstring filename)
   llassert (cstring_isDefined (cwd2));
   llassert (cstring_isDefined (filename));
 
-  abs_buffer = (char *) dmalloc (size_fromInt (cstring_length (cwd2) + cstring_length (filename) + 2));
+  abs_buffer = (char *) dmalloc (cstring_length (cwd2) + cstring_length (filename) + 2);
   endp = abs_buffer;
   
   /*
@@ -1053,6 +1054,12 @@ cstring osd_outputPath (cstring filename)
   rel_buf_p = rel_buffer;
   *rel_buf_p = '\0';
 
+  if (cwd_p == NULL) 
+    {
+      /* Need to prevent recursive assertion failures */
+      return cstring_copy (filename);
+    }
+
   llassert (cwd_p != NULL);
   llassert (path_p != NULL);
 
This page took 0.032726 seconds and 4 git commands to generate.