forked from qunying/rhide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
idesupp.cc
44 lines (39 loc) · 1000 Bytes
/
idesupp.cc
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
/* Copyright (C) 1996-2000 Robert H”hne, see COPYING.RH for details */
/* This file is part of RHIDE. */
#include "rhide.h"
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <sys/stat.h>
#include <rhutils.h>
static char *buffer = NULL;
char *
ExpandFileNameToThePointWhereTheProgramWasLoaded(const char *s)
{
string_free(buffer);
if (__file_exists(s))
{
string_dup(buffer, s);
return buffer;
}
char *spec = NULL;
string_cat(spec, "$(word 1,$(foreach file,$(addsuffix /$(notdir ", s,
"),$(RHIDE_CONFIG_DIRS)),$(wildcard $(file))))", NULL);
buffer = expand_rhide_spec(spec);
string_free(spec);
if (*buffer)
return buffer;
string_free(buffer);
string_cat(spec, "$(word 1,$(addsuffix /", s, ",$(RHIDE_CONFIG_DIRS) .))",
NULL);
buffer = expand_rhide_spec(spec);
string_free(spec);
if (!*buffer)
string_cat(buffer, s);
return buffer;
}
void
RunExternalProgram(char *, unsigned, char *)
{
}