private static int addToResultIfExists(Ruby runtime, String cwd, byte[] bytes, int begin, int end, Encoding enc, int flags, GlobFunc<GlobArgs> func, GlobArgs arg) { final String fileName = new String(bytes, begin, end - begin, enc.getCharset()); // FIXME: Ultimately JRubyFile.createResource should do this but all 1.7.x is only selectively honoring raw // paths and using system drive make it absolute. MRI does this on many methods we don't. if (Platform.IS_WINDOWS && cwd == null && !fileName.isEmpty() && fileName.charAt(0) == '/') { cwd = System.getenv("SYSTEMDRIVE"); if (cwd == null) cwd = "C:"; cwd = cwd + "/"; } FileResource file = JRubyFile.createResource(runtime, cwd, fileName); if (file.exists()) { return func.call(bytes, begin, end - begin, enc, arg); } return 0; }
private static int addToResultIfExists(Ruby runtime, String cwd, byte[] bytes, int begin, int end, Encoding enc, int flags, GlobFunc<GlobArgs> func, GlobArgs arg) { final String fileName = new String(bytes, begin, end - begin, enc.getCharset()); // FIXME: Ultimately JRubyFile.createResource should do this but all 1.7.x is only selectively honoring raw // paths and using system drive make it absolute. MRI does this on many methods we don't. if (Platform.IS_WINDOWS && cwd == null && !fileName.isEmpty() && fileName.charAt(0) == '/') { cwd = System.getenv("SYSTEMDRIVE"); if (cwd == null) cwd = "C:"; cwd = cwd + "/"; } FileResource file = JRubyFile.createResource(runtime, cwd, fileName); if (file.exists()) { return func.call(bytes, begin, end - begin, enc, arg); } return 0; }
return func.call(bytes, begin, end - begin, arg);
} else if (isJarFilePath(bytes, begin, end)) { if (getZipEntryFor(bytes, begin, end) != null) { status = func.call(bytes, begin, end, arg); buf.append(getBytesInUTF8(dirp[i])); if(m == -1) { status = func.call(buf.getUnsafeBytes(),0, buf.getRealSize(),arg); if(status != 0) { break; status = func.call(buf.getUnsafeBytes(),0, buf.getRealSize(),arg); if(status != 0) { break;
buf.append( getBytesInUTF8(file) ); if ( SLASH_INDEX == -1 ) { status = func.call(buf.getUnsafeBytes(), 0, buf.getRealSize(), enc, arg); if ( status != 0 ) break; continue;
buf.append( getBytesInUTF8(file) ); if ( SLASH_INDEX == -1 ) { status = func.call(buf.getUnsafeBytes(), 0, buf.getRealSize(), enc, arg); if ( status != 0 ) break; continue;
buf.append(getBytesInUTF8(dirp[i])); if(m == -1) { status = func.call(buf.getUnsafeBytes(),0, buf.getRealSize(),arg); if(status != 0) { break;
return func.call(bytes, begin, end - begin, arg);
public int call(byte[] ptr, int p, int len, Object ary) { GlobArgs args = (GlobArgs)ary; args.c = p; return args.func.call(ptr, args.c, len, args.v); } };
public int call(byte[] ptr, int p, int len, Encoding enc, GlobArgs args) { args.c = p; return args.func.call(ptr, args.c, len, enc, args.arg); } };
public int call(byte[] ptr, int p, int len, Object ary) { GlobArgs args = (GlobArgs)ary; args.c = p; return args.func.call(ptr, args.c, len, args.v); } };
public int call(byte[] ptr, int p, int len, Encoding enc, GlobArgs args) { args.c = p; return args.func.call(ptr, args.c, len, enc, args.arg); } };