File tree Expand file tree Collapse file tree 1 file changed +24
-12
lines changed Expand file tree Collapse file tree 1 file changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -440,23 +440,35 @@ LocateBinary() {
440
440
441
441
FindExuberantCTags ()
442
442
{
443
- binary=` LocateBinary ctags-exuberant exctags ctags`
444
- if test $? -eq 1
445
- then
443
+ #
444
+ # Search for Exuberant ctags intelligently, skipping
445
+ # over other ctags implementations.
446
+ #
447
+ binary=" "
448
+ found=0
449
+ for program in ctags-exuberant exctags ctags; do
450
+ for path in ` echo $PATH | tr ' :' ' \n' ` ; do
451
+ if [ -x " $path /$program " ]; then
452
+ binary=" $path /$program "
453
+
454
+ # Verify that this really is Exuberant Ctags.
455
+ $binary --version 2>&1 | grep " Exuberant Ctags" > /dev/null
456
+ if [ $? -eq 0 ]; then
457
+ found=1
458
+ break
459
+ fi
460
+ fi
461
+ done
462
+ if [ $found -eq 1 ]; then
463
+ break ;
464
+ fi
465
+ done
466
+ if [ $found -ne 1 ]; then
446
467
Error " Unable to determine Exuberant CTags command name" \
447
468
" for ${OS_NAME} ${OS_VERSION} "
448
469
return
449
470
fi
450
471
451
- # Verify that this really is Exuberant Ctags
452
- $binary --version 2>&1 | grep " Exuberant Ctags" > /dev/null
453
- if test $? -ne 0
454
- then
455
- Error " Unable to determine Exuberant CTags command name" \
456
- " for ${OS_NAME} ${OS_VERSION} \n(${binary} is not Exuberant CTags)"
457
- return
458
- fi
459
-
460
472
echo ${binary}
461
473
}
462
474
You can’t perform that action at this time.
0 commit comments