Rev 263 | Rev 272 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 263 | Rev 268 | ||
---|---|---|---|
Line 296... | Line 296... | ||
296 | return NULL; |
296 | return NULL; |
297 | } |
297 | } |
298 | 298 | ||
299 | Boolean fileHasExtension(StandardFileReply *sfr, const char* extension) { |
299 | Boolean fileHasExtension(StandardFileReply *sfr, const char* extension) { |
300 | #ifdef WIN_ENV |
300 | #ifdef WIN_ENV |
- | 301 | ||
301 | char name[MAX_PATH+1]; |
302 | char name[MAX_PATH+1]; |
302 | return sfr->nFileExtension && !strcasecmp(myp2cstrcpy(name,sfr->sfFile.name) + sfr->nFileExtension - 1,extension); |
303 | return sfr->nFileExtension && !strcasecmp(myp2cstrcpy(name,sfr->sfFile.name) + sfr->nFileExtension - 1,extension); |
- | 304 | ||
303 | #else |
305 | #else |
- | 306 | ||
304 | char name[1025]; // https://stackoverflow.com/questions/1295135/longest-pathname-string-in-mac-os-x-hfs |
307 | char name[1025]; // https://stackoverflow.com/questions/1295135/longest-pathname-string-in-mac-os-x-hfs |
305 | char* s = myp2cstrcpy(name,sfr->sfFile.name); |
308 | char* s = myp2cstrcpy(name,sfr->sfFile.name); |
306 | return strcmp(s + strlen(s) - strlen(extension), extension) == 0; |
309 | return strcmp(s + strlen(s) - strlen(extension), extension) == 0; |
- | 310 | ||
307 | #endif |
311 | #endif |
308 | } |
312 | } |
309 | 313 | ||
310 | Boolean readfile(StandardFileReply *sfr,char **reason){ |
314 | Boolean readfile(StandardFileReply *sfr,char **reason){ |
311 | FILEREF r; |
315 | FILEREF r; |