ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/meta/sort.c
(Generate patch)

Comparing ray/src/meta/sort.c (file contents):
Revision 1.2 by schorsch, Sun Jun 8 12:03:10 2003 UTC vs.
Revision 1.3 by schorsch, Tue Jun 10 14:26:03 2003 UTC

# Line 8 | Line 8 | static const char      RCSid[] = "$Id$";
8   #include  "paths.h"
9   #include  "meta.h"
10  
11 + #ifdef _WIN32
12 +  #include <process.h> /* getpid() */
13 + #endif
14  
15 +
16   #define  PBSIZE  1000           /* max size of sort block */
17                                  /* maxalloc must be >= this */
18  
# Line 152 | Line 156 | int  (*pcmp)(),
156   FILE  *ofp
157   )
158   {
155    char  *tfname();
159      FILE  *fi[NFILES], *fp;
160      int  i;
161      
# Line 276 | Line 279 | int  lvl, int num
279   )
280   {
281          static char  pathbuf[PATH_MAX];
282 <    static char  fnbuf[32];
282 >    static char  fnbuf[PATH_MAX];
283 >        static size_t psiz;
284  
285 +        if (pathbuf[0] == '\0') { /* first time */
286 +                temp_directory(pathbuf, sizeof(pathbuf));
287 +                psiz = strlen(pathbuf);
288 +        }
289 +        snprintf(fnbuf, sizeof(pathbuf, psiz),
290 +                        "%s/S%d%c%d", pathbuf, getpid(), lvl+'A', num);
291      /*sprintf(fnbuf, "%sS%d%c%d", TDIR, getpid(), lvl+'A', num);*/
282    sprintf(fnbuf, "%c%d_XXXXXX", lvl+'A', num);
283        temp_filename(pathbuf, sizeof(pathbuf), fnbuf);
292  
293 <    /*return(fnbuf);*/
286 <        return pathbuf;
293 >    return(fnbuf);
294   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines