/usr/share/doc/gnat-gps/examples/language/gprcustom.c is in gnat-gps-doc 5.3dfsg-1ubuntu1.
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 | #include <string.h>
#include <stdlib.h>
#include "language_custom.h"
char *
gpr_comment_line (char *line, char comment, int length)
{
char *s;
if (comment)
{
s = malloc (length + 4 + 1);
strncpy (s, "-- ", 4);
strncpy (s + 4, line, length);
s [length + 4] = '\0';
return s;
}
else
{
if (length > 4 && !strncmp (line, "-- ", 4))
{
s = malloc (length - 3);
strncpy (s, line + 4, length - 4);
s [length - 4] = '\0';
return s;
}
else
{
s = malloc (length + 1);
strncpy (s, line, length);
s [length] = '\0';
return s;
}
}
}
|