This file is indexed.

/usr/share/slsh/sldb.sl is in slsh 2.3.1-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
% Copyright (C) 2012-2016 John E. Davis
%
% This file is part of the S-Lang Library and may be distributed under the
% terms of the GNU General Public License.  See the file COPYING for
% more information.
%---------------------------------------------------------------------------
require ("sldbcore");

private define vmessage_method ()
{
   variable args = __pop_args (_NARGS);
   () = fprintf (stdout, __push_args (args));
   () = fflush (stdout);
}

private define open_file_at_linenum (file, linenum)
{
   if (path_extname (file) == ".slc")
     file = path_sans_extname (file) + ".sl";

   variable fp = fopen (file, "r");
   if (fp == NULL)
     {
	vmessage_method ("Unable to open %s\n", file);
	return NULL;
     }
   if (linenum == 1)
     return fp;

   foreach (fp) using ("line")
     {
	variable line = ();
	linenum--;
	if (linenum == 1)
	  break;
     }
   return fp;
}

private define list_method (file, linemin, linemax)
{
   variable n = linemax - linemin + 1;
   foreach (open_file_at_linenum (file, linemin))
     {
	variable line = ();
	vmessage_method ("%d\t%s", linemin, line);
	%vmessage_method ("> %s:%d %s", file, linemin, line);
	linemin++;
	if (linemin > linemax)
	  break;
     }
}

#ifexists slsh_readline
slsh_readline_init ("SLDB");
private variable Rline = NULL;
private define close_readline ()
{
   Rline = NULL;
}
Rline = slsh_readline_new ("sldb");
atexit (&close_readline);
#endif

private define read_input_method (prompt, default_cmd)
{
   variable line;
   forever
     {
	try
	  {
#ifexists slsh_readline
	     line = slsh_readline (Rline, prompt);
#else
	     () = fputs (prompt, stdout); () = fflush(stdout);
	     if (-1 == fgets (&line, stdin))
	       line = NULL;
#endif
	  }
	catch UserBreakError: continue;
	if (line == NULL)
	  break;

	line = strtrim (line, "\t \n");
	if (line == "")
	  {
	     if (default_cmd != NULL)
	       return default_cmd;
	     continue;
	  }
	break;
     }
   return line;
}

define sldb_initialize ()
{
   variable m = sldb_methods ();
   m.list = &list_method;
   m.vmessage = &vmessage_method;
   m.read_input = &read_input_method;
   m.pprint = &print;
}

provide ("sldb");