|
25 | 25 | // Lispm epoch is 1/1/1900 |
26 | 26 | #define EPOCH_OFFSET 2208988800 |
27 | 27 |
|
| 28 | +#include "config.h" |
28 | 29 | #include <fuse.h> |
29 | 30 | #include <stdio.h> |
30 | 31 | #include <stdint.h> |
@@ -671,10 +672,12 @@ int lmfs_getent(char *path,Directory_Entry *dirent){ |
671 | 672 | // Split for filename and file type |
672 | 673 | path_element_name = strtok_r(path_element,".",&pe_saveptr); |
673 | 674 | path_element_type = strtok_r(NULL,"/",&pe_saveptr); |
674 | | - if(strstr(path_element_type,"#") != NULL){ |
| 675 | + if(path_element_type != NULL && strstr(path_element_type,"#") != NULL){ |
| 676 | + // fprintf(stderr,"LMFS: path_element_type found number sign: %s\n",path_element_type); |
675 | 677 | path_element_type = strtok_r(path_element_type,"#",&pe_saveptr); // Chop off before # |
676 | 678 | path_element_version = strtok_r(NULL,"/",&pe_saveptr); // Chop off version |
677 | 679 | }else{ |
| 680 | + // fprintf(stderr,"LMFS: No version specified in this path element.\n"); |
678 | 681 | path_element_version = NULL; |
679 | 682 | } |
680 | 683 | }else{ |
@@ -917,7 +920,7 @@ static int lmfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, |
917 | 920 | stbuf.st_nlink = 2; |
918 | 921 | } |
919 | 922 | // Common stuff |
920 | | - stbuf.st_mtimespec.tv_sec = dirent.cdate-EPOCH_OFFSET; |
| 923 | + stbuf.st_mtime = dirent.cdate-EPOCH_OFFSET; |
921 | 924 | stbuf.st_size = dirent.total_size; |
922 | 925 | stbuf.st_blocks = dirent.total_size/512; |
923 | 926 | if(dirent.total_size > stbuf.st_blocks*512){ |
@@ -963,7 +966,7 @@ static int lmfs_getattr(const char *path, struct stat *stbuf){ |
963 | 966 | stbuf->st_nlink = 2; |
964 | 967 | } |
965 | 968 | // Common stuff |
966 | | - stbuf->st_mtimespec.tv_sec = dirent.cdate-EPOCH_OFFSET; |
| 969 | + stbuf->st_mtime = dirent.cdate-EPOCH_OFFSET; |
967 | 970 | stbuf->st_size = dirent.total_size; |
968 | 971 | stbuf->st_blksize = 1024; |
969 | 972 | stbuf->st_blocks = dirent.total_size/512; |
|
0 commit comments