summarylogtreecommitdiffstats
path: root/0007-fix-wrong-return-value.patch
diff options
context:
space:
mode:
authoroi_wtf2017-02-12 23:40:50 +0100
committeroi_wtf2017-02-12 23:40:50 +0100
commit3116b71819f765218de54dcf188c387c312f8f11 (patch)
tree809c47a1cc40af59e493102417bc137a699e2136 /0007-fix-wrong-return-value.patch
parentfe10896c6892f41fc3dde6c3d3502d40e4c57e6c (diff)
downloadaur-3116b71819f765218de54dcf188c387c312f8f11.tar.gz
20150125-2
fix wrong value returned inside physfsDrive::opendir
Diffstat (limited to '0007-fix-wrong-return-value.patch')
-rw-r--r--0007-fix-wrong-return-value.patch167
1 files changed, 167 insertions, 0 deletions
diff --git a/0007-fix-wrong-return-value.patch b/0007-fix-wrong-return-value.patch
new file mode 100644
index 000000000000..8f4bd4fcfcf9
--- /dev/null
+++ b/0007-fix-wrong-return-value.patch
@@ -0,0 +1,167 @@
+--- ./src/dos/drive_physfs.cpp.orig 2015-01-25 08:51:05.573082100 +0100
++++ ./src/dos/drive_physfs.cpp 2017-02-12 23:33:04.972086247 +0100
+@@ -57,7 +57,7 @@
+ bool prepareWrite();
+ bool Close();
+ Bit16u GetInformation(void);
+- bool UpdateDateTimeFromHost(void);
++ bool UpdateDateTimeFromHost(void);
+ private:
+ PHYSFS_file * fhandle;
+ enum { READ,WRITE } last_action;
+@@ -94,7 +94,7 @@
+
+ /* Test if file exists, don't add to dirCache then */
+ bool existing_file=PHYSFS_exists(newname);
+-
++
+ char *slash = strrchr(newname,'/');
+ if (slash && slash != newname) {
+ char file[CROSS_LEN];
+@@ -131,7 +131,7 @@
+ normalize(newname,basedir);
+
+ PHYSFS_file * hand;
+-
++
+ if (!PHYSFS_exists(newname)) return false;
+ if ((flags&0xf) == OPEN_READ) {
+ hand = PHYSFS_openRead(newname);
+@@ -141,7 +141,7 @@
+ hand = PHYSFS_openRead(newname);
+ }
+
+- if (!hand) {
++ if (!hand) {
+ if((flags&0xf) != OPEN_READ) {
+ PHYSFS_file *hmm = PHYSFS_openRead(newname);
+ if (hmm) {
+@@ -151,7 +151,7 @@
+ }
+ return false;
+ }
+-
++
+ *file=new physfsFile(name,hand,0x202,newname,false);
+ (*file)->flags=flags; //for the inheritance flag and maybe check for others.
+ return true;
+@@ -182,7 +182,7 @@
+
+ char end[2]={CROSS_FILESPLIT,0};
+ if (tempDir[strlen(tempDir)-1]!=CROSS_FILESPLIT) strcat(tempDir,end);
+-
++
+ Bit16u id;
+ if (!dirCache.FindFirst(tempDir,id))
+ {
+@@ -191,7 +191,7 @@
+ }
+ strcpy(srchInfo[id].srch_dir,tempDir);
+ dta.SetDirID(id);
+-
++
+ Bit8u sAttr;
+ dta.GetSearchParams(sAttr,tempDir);
+
+@@ -203,7 +203,7 @@
+ }
+ dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME);
+ return true;
+- } else if ((sAttr & DOS_ATTR_VOLUME) && (*_dir == 0) && !fcb_findfirst) {
++ } else if ((sAttr & DOS_ATTR_VOLUME) && (*_dir == 0) && !fcb_findfirst) {
+ //should check for a valid leading directory instead of 0
+ //exists==true if the volume label matches the searchmask and the path is valid
+ if ( strcmp(dirCache.GetLabel(), "") == 0 ) {
+@@ -228,7 +228,7 @@
+ Bit8u find_attr;
+
+ dta.GetSearchParams(srch_attr,srch_pattern);
+-
++
+ Bitu id = dta.GetDirID();
+
+ again:
+@@ -242,17 +242,17 @@
+ if(strlen(dir_ent)<DOS_NAMELENGTH_ASCII){
+ strcpy(find_name,dir_ent);
+ upcase(find_name);
+- }
++ }
+
+ strcpy(full_name,srchInfo[id].srch_dir);
+ strcat(full_name,dir_ent);
+ dirCache.ExpandName(full_name);
+ normalize(full_name,basedir);
+-
++
+ if (PHYSFS_isDirectory(full_name)) find_attr=DOS_ATTR_DIRECTORY|DOS_ATTR_ARCHIVE;
+ else find_attr=DOS_ATTR_ARCHIVE;
+ if (~srch_attr & find_attr & (DOS_ATTR_DIRECTORY | DOS_ATTR_HIDDEN | DOS_ATTR_SYSTEM)) goto again;
+-
++
+ /*file is okay, setup everything to be copied in DTA Block */
+ find_size=(Bit32u)PHYSFS_fileLength(full_name);
+ time_t mytime = PHYSFS_getLastModTime(full_name);
+@@ -261,7 +261,7 @@
+ find_date=DOS_PackDate((Bit16u)(time->tm_year+1900),(Bit16u)(time->tm_mon+1),(Bit16u)time->tm_mday);
+ find_time=DOS_PackTime((Bit16u)time->tm_hour,(Bit16u)time->tm_min,(Bit16u)time->tm_sec);
+ } else {
+- find_time=6;
++ find_time=6;
+ find_date=4;
+ }
+ dta.SetResult(find_name,find_size,find_date,find_time,find_attr);
+@@ -332,7 +332,7 @@
+ CROSS_FILENAME(newold);
+ dirCache.ExpandName(newold);
+ normalize(newold,basedir);
+-
++
+ char newnew[CROSS_LEN];
+ strcpy(newnew,basedir);
+ strcat(newnew,newname);
+@@ -415,7 +415,7 @@
+ char myname[CROSS_LEN];
+ strcpy(myname,name);
+ normalize(myname,basedir);
+- if (!PHYSFS_isDirectory(myname)) return false;
++ if (!PHYSFS_isDirectory(myname)) return NULL;
+
+ struct opendirinfo *oinfo = (struct opendirinfo *)malloc(sizeof(struct opendirinfo));
+ oinfo->files = PHYSFS_enumerateFiles(myname);
+@@ -476,7 +476,7 @@
+ strcpy(newname,startdir);
+ }
+
+- CROSS_FILENAME(newname);
++ CROSS_FILENAME(newname);
+ if (!physfs_used) {
+ PHYSFS_init("");
+ PHYSFS_permitSymbolicLinks(1);
+@@ -510,7 +510,7 @@
+ PHYSFS_setWriteDir(oldwrite);
+ }
+ if (oldwrite) free((char *)oldwrite);
+-
++
+ strcpy(basedir,lastdir);
+
+ allocation.bytes_sector=_bytes_sector;
+@@ -599,7 +599,7 @@
+ }
+
+ if (!PHYSFS_seek(fhandle,mypos)) {
+- // Out of file range, pretend everythings ok
++ // Out of file range, pretend everythings ok
+ // and move file pointer top end of file... ?! (Black Thorne)
+ PHYSFS_seek(fhandle,PHYSFS_fileLength(fhandle));
+ };
+@@ -682,7 +682,7 @@
+ Bit16u physfsFile::GetInformation(void) {
+ return info;
+ }
+-
++
+
+ physfsFile::physfsFile(const char* _name, PHYSFS_file * handle,Bit16u devinfo, const char* physname, bool write) {
+ fhandle=handle;