Refix binfile path issue and remove unused code in dsojson

This commit is contained in:
pancake 2015-08-16 22:41:58 +02:00
parent 752af9a89e
commit 6ced6fa8b4
2 changed files with 4 additions and 6 deletions

View File

@ -306,7 +306,11 @@ static int r_core_file_do_load_for_debug (RCore *r, ut64 loadaddr, const char *f
}
#endif
// HACK if its a relative path, load from disk instead of memory
#if __APPLE__
int fd = (filenameuri[0] == '.')? -1: desc->fd;
#else
int fd = desc->fd;
#endif
if (!r_bin_load (r->bin, filenameuri, baseaddr, loadaddr, xtr_idx, fd, treat_as_rawstr)) {
eprintf ("Cannot open %s\n", filenameuri);
if (r_config_get_i (r->config, "bin.rawstr")) {

View File

@ -12,7 +12,6 @@ R_API char * dso_json_dict_to_str (DsoJsonDict *list);
R_API char * dso_json_num_to_str (DsoJsonNum * num);
R_API char * dso_json_str_to_str (DsoJsonStr *str);
static int cmpDsoStr (DsoJsonStr *dsoStr1, DsoJsonStr *dsoStr2);
static int cmpDsoStr_to_str (DsoJsonStr *dsoStr1, char *dsoStr2);
static const DsoJsonInfo* get_type_info (unsigned int type);
static char * dso_json_get_str_data (DsoJsonObj *dso_obj);
@ -165,11 +164,6 @@ static const DsoJsonInfo* get_type_info (unsigned int type) {
return NULL;
}
static int cmpDsoStr (DsoJsonStr *dsoStr1, DsoJsonStr *dsoStr2) {
if (dsoStr1 && dsoStr2) return cmpDsoStr_to_str (dsoStr1, dsoStr2->data);
return -1;
}
static int cmpDsoStr_to_str (DsoJsonStr *dsoStr1, char *dsoStr2) {
if (dsoStr1 && dsoStr1->data && dsoStr2)
return strcmp (dsoStr1->data, dsoStr2);