CVS code -
- files.c:
+ free_charptrarray, striponedir()
+ - Plug some memory leaks (Steven Kneizys).
read_file()
- Abort if we read a file of 0 lines (num_lines == 0), fixes BUG #70.
- winio.c:
{
int i;
- for (i = 0; i < len - 1; i++)
+ for (i = 0; i < len; i++)
free(array[i]);
free(array);
}
if (tmp != foo)
*tmp = 0;
else
+ { /* SPK may need to make a 'default' path here */
+ if (*tmp != '/') *(tmp) = '.';
*(tmp+1) = 0;
+ }
return;
}
else
path = mallocstrcpy(path, filelist[selected]);
+ /* SPK for '.' path, get the current path via getcwd */
+ if (!strcmp(path, "./..")) {
+ free(path);
+ path = getcwd(NULL, 0);
+ striponedir(path);
+ align(&path);
+ free_charptrarray(filelist, numents);
+ free(foo);
+ return do_browser(path);
+ }
+
st = filestat(path);
if (S_ISDIR(st.st_mode)) {
if (opendir(path) == NULL) {
}
/* Start over again with the new path value */
+ free_charptrarray(filelist, numents);
+ free(foo);
return do_browser(path);
} else {
retval = path;