9
9
#include <insns_info.inc>
10
10
#include "ruby_debug.h"
11
11
12
- #define DEBUG_VERSION "0.11.30.pre5 "
12
+ #define DEBUG_VERSION "0.11.30.pre6 "
13
13
14
14
#define FRAME_N (n ) (&debug_context->frames[debug_context->stack_size-(n)-1])
15
15
#define GET_FRAME (FRAME_N(check_frame_number(debug_context, frame)))
@@ -510,18 +510,6 @@ save_call_frame(rb_event_flag_t _event, debug_context_t *debug_context, VALUE se
510
510
copy_scalar_args (debug_frame );
511
511
}
512
512
513
- char *
514
- resolve_symlink (char * file ) {
515
- char * result ;
516
- #ifdef PATH_MAX
517
- result = (char * )malloc (PATH_MAX );
518
- #else
519
- result = NULL ;
520
- #endif
521
- return realpath (file , result );
522
- }
523
-
524
-
525
513
#if defined DOSISH
526
514
#define isdirsep (x ) ((x) == '/' || (x) == '\\')
527
515
#else
@@ -530,9 +518,28 @@ resolve_symlink(char *file) {
530
518
531
519
int
532
520
filename_cmp (VALUE source , char * file ) {
533
- char * path ;
534
- path = RTEST (resolve_symlinks ) ? resolve_symlink (file ) : file ;
535
- return filename_cmp_impl (source , path );
521
+ if (!RTEST (resolve_symlinks )) {
522
+ return filename_cmp_impl (source , file );
523
+ }
524
+
525
+ #ifdef PATH_MAX
526
+ {
527
+ char path [PATH_MAX + 1 ];
528
+ path [PATH_MAX ] = 0 ;
529
+
530
+ if (realpath (source , path ) != NULL )
531
+ return filename_cmp_impl (source , path );
532
+ else
533
+ return filename_cmp_impl (source , file );
534
+ }
535
+ #else
536
+ {
537
+ char * path = realpath (file , NULL );
538
+ result = filename_cmp_impl (source , path == NULL ? file : path );
539
+ free (path );
540
+ return result ;
541
+ }
542
+ #endif
536
543
}
537
544
538
545
int
0 commit comments