Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
1d53c135
Commit
1d53c135
authored
Aug 30, 2003
by
rswindell
Browse files
When uploading a local file (already on disk), the correct filename case is
used.
parent
88d34550
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
src/sbbs3/upload.cpp
src/sbbs3/upload.cpp
+11
-16
No files found.
src/sbbs3/upload.cpp
View file @
1d53c135
...
...
@@ -238,8 +238,11 @@ bool sbbs_t::uploadfile(file_t *f)
/****************************************************************************/
bool
sbbs_t
::
upload
(
uint
dirnum
)
{
char
str
[
256
],
src
[
256
]
=
{
""
},
descbeg
[
25
]
=
{
""
},
descend
[
25
]
=
{
""
}
,
path
[
256
]
char
descbeg
[
25
]
=
{
""
},
descend
[
25
]
=
{
""
}
,
fname
[
13
],
keys
[
256
],
ch
,
*
p
;
char
str
[
MAX_PATH
+
1
];
char
path
[
MAX_PATH
+
1
];
char
spath
[
MAX_PATH
+
1
];
char
tmp
[
512
];
time_t
start
,
end
;
uint
i
,
j
,
k
,
destuser
[
MAX_USERXFER
],
destusers
=
0
;
...
...
@@ -306,9 +309,14 @@ bool sbbs_t::upload(uint dirnum)
,
cfg
.
dir
[
dirnum
]
->
sname
);
if
(
!
yesno
(
str
))
return
(
false
);
action
=
NODE_ULNG
;
padfname
(
fname
,
f
.
name
);
sprintf
(
str
,
"%s%s"
,
path
,
fname
);
if
(
fexistcase
(
str
))
{
/* File is on disk */
#ifdef _WIN32
GetShortPathName
(
str
,
spath
,
sizeof
(
spath
));
#else
SAFECOPY
(
spath
,
str
);
#endif
SAFECOPY
(
fname
,
getfname
(
spath
));
if
(
!
dir_op
(
dirnum
)
&&
online
!=
ON_LOCAL
)
{
/* local users or sysops */
bprintf
(
text
[
FileAlreadyThere
],
fname
);
return
(
false
);
...
...
@@ -316,14 +324,7 @@ bool sbbs_t::upload(uint dirnum)
if
(
!
yesno
(
text
[
FileOnDiskAddQ
]))
return
(
false
);
}
else
if
(
online
==
ON_LOCAL
)
{
bputs
(
text
[
FileNotOnDisk
]);
bputs
(
text
[
EnterPath
]);
if
(
!
getstr
(
tmp
,
60
,
K_LINE
))
return
(
false
);
backslash
(
tmp
);
sprintf
(
src
,
"%s%s"
,
tmp
,
fname
);
}
padfname
(
fname
,
f
.
name
);
strcpy
(
str
,
cfg
.
dir
[
dirnum
]
->
exts
);
strcpy
(
tmp
,
f
.
name
);
truncsp
(
tmp
);
...
...
@@ -447,12 +448,6 @@ bool sbbs_t::upload(uint dirnum)
f
.
misc
|=
FM_ANON
;
}
sprintf
(
str
,
"%s%s"
,
path
,
fname
);
if
(
src
[
0
])
{
/* being copied from another local dir */
bprintf
(
text
[
RetrievingFile
],
fname
);
if
(
mv
(
src
,
str
,
1
))
return
(
false
);
CRLF
;
}
if
(
fexistcase
(
str
))
{
/* File is on disk */
if
(
!
uploadfile
(
&
f
))
return
(
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment