improve w3m search. do not search for w3mimgdisplay in example. fixes #119.
This commit is contained in:
parent
f6b5b8811a
commit
9105c80eb7
|
@ -101,7 +101,8 @@ var icon = blessed.image({
|
|||
left: 0,
|
||||
width: 'shrink',
|
||||
height: 'shrink',
|
||||
file: __dirname + '/my-program-icon.png'
|
||||
file: __dirname + '/my-program-icon.png',
|
||||
search: false
|
||||
});
|
||||
|
||||
// If our box is clicked, change the content.
|
||||
|
|
|
@ -7995,7 +7995,9 @@ function Image(options) {
|
|||
if (fs.existsSync(Image.w3mdisplay)) {
|
||||
Image.hasW3MDisplay = true;
|
||||
} else if (options.search !== false) {
|
||||
var file = findFile('/', 'w3mimgdisplay');
|
||||
var file = findFile('/usr', 'w3mimgdisplay')
|
||||
|| findFile('/lib', 'w3mimgdisplay')
|
||||
|| findFile('/bin', 'w3mimgdisplay');
|
||||
if (file) {
|
||||
Image.hasW3MDisplay = true;
|
||||
Image.w3mdisplay = file;
|
||||
|
@ -8456,12 +8458,12 @@ function findFile(start, target) {
|
|||
}
|
||||
|
||||
try {
|
||||
stat = fs.statSync((dir === '/' ? '' : dir) + '/' + file);
|
||||
stat = fs.lstatSync((dir === '/' ? '' : dir) + '/' + file);
|
||||
} catch (e) {
|
||||
stat = null;
|
||||
}
|
||||
|
||||
if (stat && stat.isDirectory()) {
|
||||
if (stat && stat.isDirectory() && !stat.isSymbolicLink()) {
|
||||
out = read((dir === '/' ? '' : dir) + '/' + file);
|
||||
if (out) return out;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue