diff --git a/index.js b/index.js index cb03219..61615f1 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,7 @@ var path = require('path'); var isglob = require('is-glob'); module.exports = function globParent(str) { - while (isglob(str)) str = path.dirname(str); + str += 'a'; // preserves full path in case of trailing path separator + do {str = path.dirname(str)} while (isglob(str)); return str; };