Skip to content

Commit

Permalink
fix: Support Windows UNC paths in debug images (#11010)
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-auer committed Dec 11, 2018
1 parent dea5ab6 commit b9843d6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/sentry/lang/native/utils.py
Expand Up @@ -16,7 +16,7 @@
VERSION_RE = re.compile(r'(\d+\.\d+\.\d+)\s+(.*)')

# Regular expression to guess whether we're dealing with Windows or Unix paths
WINDOWS_PATH_RE = re.compile(r'^[a-z]:\\', re.IGNORECASE)
WINDOWS_PATH_RE = re.compile(r'^([a-z]:\\|\\\\)', re.IGNORECASE)

AppInfo = namedtuple('AppInfo', ['id', 'version', 'build', 'name'])

Expand Down
Expand Up @@ -45,7 +45,7 @@ class EventErrorItem extends React.Component {

if (typeof data.image_path === 'string') {
// Separate the image name for readability
let separator = /^[a-z]:\\/i.test(data.image_path) ? '\\' : '/';
let separator = /^([a-z]:\\|\\\\)/i.test(data.image_path) ? '\\' : '/';
let path = data.image_path.split(separator);
data.image_name = path.splice(-1, 1)[0];
data.image_path = path.length ? path.join(separator) + separator : '';
Expand Down
Expand Up @@ -19,7 +19,7 @@ class DebugMetaInterface extends React.Component {
return null;
}

let name = img.name.split(/^[a-z]:\\/i.test(img.name) ? '\\' : '/').pop();
let name = img.name.split(/^([a-z]:\\|\\\\)/i.test(img.name) ? '\\' : '/').pop();
if (name == 'dyld_sim') return null; // this is only for simulator builds

let version = null;
Expand Down
Expand Up @@ -17,7 +17,7 @@ import Truncate from 'app/components/truncate';
import space from 'app/styles/space';

export function trimPackage(pkg) {
let pieces = pkg.split(/^[a-z]:\\/i.test(pkg) ? '\\' : '/');
let pieces = pkg.split(/^([a-z]:\\|\\\\)/i.test(pkg) ? '\\' : '/');
let filename = pieces[pieces.length - 1] || pieces[pieces.length - 2] || pkg;
return filename.replace(/\.(dylib|so|a|dll|exe)$/, '');
}
Expand Down
Expand Up @@ -230,7 +230,7 @@ const ProjectProcessingIssues = createReactClass({
},

getImageName(path) {
let pathSegments = path.split(/^[a-z]:\\/i.test(path) ? '\\' : '/');
let pathSegments = path.split(/^([a-z]:\\|\\\\)/i.test(path) ? '\\' : '/');
return pathSegments[pathSegments.length - 1];
},

Expand Down

0 comments on commit b9843d6

Please sign in to comment.