@@ -971,28 +971,18 @@ IO_stat MCDispatch::doreadfile(MCStringRef p_openpath, MCStringRef p_name, IO_ha
971971
972972IO_stat MCDispatch::loadfile (MCStringRef p_name, MCStack *&sptr)
973973{
974- IO_handle stream;
974+ IO_handle stream;
975975 MCAutoStringRef t_open_path;
976976
977977 bool t_found;
978978 t_found = false ;
979979 if (!t_found)
980980 {
981981 if ((stream = MCS_open (p_name, kMCOpenFileModeRead , True, False, 0 )) != NULL )
982- {
983- // This should probably use resolvepath().
984- if (MCStringGetCharAtIndex (p_name, 0 ) != PATH_SEPARATOR
985- && MCStringGetCharAtIndex (p_name, 1 ) != ' :' )
986- {
987- MCAutoStringRef t_curpath;
988-
989- /* UNCHECKED */ MCS_getcurdir (&t_curpath);
990- /* UNCHECKED */ MCStringFormat (&t_open_path, " %@/%@" , *t_curpath, p_name);
991- }
992- else
993- t_open_path = p_name;
994-
995- t_found = true ;
982+ {
983+ // This should probably use resolvepath().
984+ // SN-2015-06-03: [[ Bug 15432 ]] Use resolvepath
985+ t_found = MCS_resolvepath (p_name, &t_open_path);
996986 }
997987 }
998988
@@ -1007,7 +997,7 @@ IO_stat MCDispatch::loadfile(MCStringRef p_name, MCStack *&sptr)
1007997 else
1008998 t_leaf_name = p_name;
1009999 if ((stream = MCS_open (*t_leaf_name, kMCOpenFileModeRead , True, False, 0 )) != NULL )
1010- {
1000+ {
10111001 MCAutoStringRef t_curpath;
10121002 /* UNCHECKED */ MCS_getcurdir (&t_curpath);
10131003 /* UNCHECKED */ MCStringFormat (&t_open_path, " %@/%@" , *t_curpath, p_name);
0 commit comments