Skip to content

Commit

Permalink
Merge pull request #11330 from unknownbrackets/mac-realpath
Browse files Browse the repository at this point in the history
Use a larger buffer for realpath()
  • Loading branch information
hrydgard committed Aug 26, 2018
2 parents 4cb230d + 274b1ea commit 773dba1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Common/FileUtil.cpp
Expand Up @@ -24,6 +24,7 @@


#include "ppsspp_config.h" #include "ppsspp_config.h"


#include <memory>
#include "FileUtil.h" #include "FileUtil.h"
#include "StringUtils.h" #include "StringUtils.h"


Expand Down Expand Up @@ -152,11 +153,12 @@ std::string ResolvePath(const std::string &path) {
output = output.substr(4); output = output.substr(4);
delete [] buf; delete [] buf;
return output; return output;

#else #else
char buf[PATH_MAX + 1]; std::unique_ptr<char[]> buf(new char[PATH_MAX + 32768]);
if (realpath(path.c_str(), buf) == nullptr) if (realpath(path.c_str(), buf.get()) == nullptr)
return path; return path;
return buf; return buf.get();
#endif #endif
} }


Expand Down
2 changes: 1 addition & 1 deletion GPU/Common/GPUStateUtils.cpp
Expand Up @@ -48,7 +48,7 @@ bool NeedsTestDiscard() {
return true; return true;
if (!gstate.isAlphaBlendEnabled()) if (!gstate.isAlphaBlendEnabled())
return true; return true;
if (gstate.getBlendFuncA() != GE_SRCBLEND_SRCALPHA && gstate.getBlendFuncA() != GE_DSTBLEND_DOUBLESRCALPHA) if (gstate.getBlendFuncA() != GE_SRCBLEND_SRCALPHA && gstate.getBlendFuncA() != GE_SRCBLEND_DOUBLESRCALPHA)
return true; return true;
// GE_DSTBLEND_DOUBLEINVSRCALPHA is actually inverse double src alpha, and doubling zero is still zero. // GE_DSTBLEND_DOUBLEINVSRCALPHA is actually inverse double src alpha, and doubling zero is still zero.
if (gstate.getBlendFuncB() != GE_DSTBLEND_INVSRCALPHA && gstate.getBlendFuncB() != GE_DSTBLEND_DOUBLEINVSRCALPHA) { if (gstate.getBlendFuncB() != GE_DSTBLEND_INVSRCALPHA && gstate.getBlendFuncB() != GE_DSTBLEND_DOUBLEINVSRCALPHA) {
Expand Down

0 comments on commit 773dba1

Please sign in to comment.