Ignore:
Timestamp:
Jul 9, 2020, 8:51:43 AM (4 years ago)
Author:
coas-nagasima
Message:

mrubyを2.1.1に更新

Location:
EcnlProtoTool/trunk/mruby-2.1.1
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c

    r331 r439  
    4949  }
    5050
    51   path = mrb_malloc(mrb, len);
     51  path = (char*)mrb_malloc(mrb, len);
    5252  memset(path, 0, len);
    5353
     
    6565{
    6666  size_t len;
    67   char *p, *dir;
     67  const char *p;
     68  char *dir;
    6869
    6970  if (path == NULL) {
     
    7475  len = p != NULL ? (size_t)(p - path) : strlen(path);
    7576
    76   dir = mrb_malloc(mrb, len + 1);
     77  dir = (char*)mrb_malloc(mrb, len + 1);
    7778  strncpy(dir, path, len);
    7879  dir[len] = '\0';
     
    8485source_file_new(mrb_state *mrb, mrb_debug_context *dbg, char *filename)
    8586{
    86   source_file *file = NULL;
    87 
    88   file = mrb_malloc(mrb, sizeof(source_file));
     87  source_file *file;
     88
     89  file = (source_file*)mrb_malloc(mrb, sizeof(source_file));
    8990
    9091  memset(file, '\0', sizeof(source_file));
     
    9798
    9899  file->lineno = 1;
    99   file->path = mrb_malloc(mrb, strlen(filename) + 1);
     100  file->path = (char*)mrb_malloc(mrb, strlen(filename) + 1);
    100101  strcpy(file->path, filename);
    101102  return file;
     
    175176  const char *search_path[3];
    176177  char *path = NULL;
     178  const char *srcname = strrchr(filename, '/');
     179
     180  if (srcname) srcname++;
     181  else srcname = filename;
    177182
    178183  search_path[0] = srcpath;
    179   search_path[1] = dirname(mrb, mrb_debug_get_filename(mrdb->dbg->root_irep, 0));
     184  search_path[1] = dirname(mrb, mrb_debug_get_filename(mrb, mrdb->dbg->irep, 0));
    180185  search_path[2] = ".";
    181186
     
    185190    }
    186191
    187     if ((path = build_path(mrb, search_path[i], filename)) == NULL) {
     192    if ((path = build_path(mrb, search_path[i], srcname)) == NULL) {
    188193      continue;
    189194    }
Note: See TracChangeset for help on using the changeset viewer.