projects
/
rrq
/
fusefile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3c70a96
)
Allow for fragment pathnames including "/" without range appendix.
author
Ralph Ronnquist
<rrq@rrq.au>
Mon, 7 Aug 2023 04:29:20 +0000
(14:29 +1000)
committer
Ralph Ronnquist
<rrq@rrq.au>
Mon, 7 Aug 2023 04:29:20 +0000
(14:29 +1000)
fusefile.c
patch
|
blob
|
history
diff --git
a/fusefile.c
b/fusefile.c
index f6d7bc84859506cad1a272cdab9e7f9dfa1791ad..37f8a2c0448de17eb35174090fdae01393cdbcec 100644
(file)
--- a/
fusefile.c
+++ b/
fusefile.c
@@
-295,8
+295,14
@@
static int RANGE(int s,int n ) {
static int setup_source(struct Source *p,char *frag) {
struct stat filestat;
// Open the fragment file rw if possible, else ro
static int setup_source(struct Source *p,char *frag) {
struct stat filestat;
// Open the fragment file rw if possible, else ro
- range = strrchr( frag, '/' ); // last '/'
- p->filename = range? strndup( frag, range - frag ) : frag;
+ // First try the fragment in full, thereafter with range appendix
+ if ( stat( frag, &filestat ) == 0 ) {
+ p->filename = strdup( frag );
+ range = 0;
+ } else {
+ range = strrchr( frag, '/' ); // last '/'
+ p->filename = range? strndup( frag, range - frag ) : frag;
+ }
p->fd = open( p->filename, O_RDWR );
int rdonly = 0;
if ( p->fd < 0 ) {
p->fd = open( p->filename, O_RDWR );
int rdonly = 0;
if ( p->fd < 0 ) {
@@
-307,7
+313,7
@@
static int setup_source(struct Source *p,char *frag) {
perror( p->filename );
return 1; // Error return
}
perror( p->filename );
return 1; // Error return
}
- if ( stat( p->filename, &filestat ) ) {
+ if (
( range == 0 ) &&
stat( p->filename, &filestat ) ) {
perror( p->filename );
return 1;
}
perror( p->filename );
return 1;
}