merge
This commit is contained in:
commit
e410404208
|
@ -428,6 +428,11 @@ Sys_Get_Canonical_Sig(system_get_canonical){
|
||||||
char* write_p = path;
|
char* write_p = path;
|
||||||
const char* read_p = filename;
|
const char* read_p = filename;
|
||||||
|
|
||||||
|
// return 0 for relative paths (e.g. cmdline args)
|
||||||
|
if(len > 0 && filename[0] != '/'){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
while(read_p < filename + len){
|
while(read_p < filename + len){
|
||||||
if(read_p == filename || read_p[0] == '/'){
|
if(read_p == filename || read_p[0] == '/'){
|
||||||
if(read_p[1] == '/'){
|
if(read_p[1] == '/'){
|
||||||
|
@ -502,9 +507,11 @@ Sys_Load_File_Sig(system_load_file){
|
||||||
int fd = *(int*)&handle;
|
int fd = *(int*)&handle;
|
||||||
do {
|
do {
|
||||||
ssize_t n = read(fd, buffer, size);
|
ssize_t n = read(fd, buffer, size);
|
||||||
if(n == -1 && errno != EAGAIN){
|
if(n == -1){
|
||||||
perror("read");
|
if(errno != EINTR){
|
||||||
break;
|
perror("read");
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
size -= n;
|
size -= n;
|
||||||
buffer += n;
|
buffer += n;
|
||||||
|
|
Loading…
Reference in New Issue