Search for .mspdebug in current directory first.
This commit is contained in:
parent
8bed72bb48
commit
09c2acbfd6
11
mspdebug.man
11
mspdebug.man
|
@ -20,10 +20,13 @@ It supports a variety of file formats, described in the section
|
||||||
\fBBINARY FORMATS\fR below. It can also be used as a remote stub
|
\fBBINARY FORMATS\fR below. It can also be used as a remote stub
|
||||||
for \fBgdb\fR(1).
|
for \fBgdb\fR(1).
|
||||||
|
|
||||||
On startup, MSPDebug will look for a file called .mspdebug in the user's
|
On startup, MSPDebug will look for a file called .mspdebug first in the
|
||||||
home directory. If it exists, commands will be read and executed from this
|
current directory, and then in the user's home directory. If either file
|
||||||
file before executing any other commands or starting the interactive
|
exists, commands will be read and executed from this file before
|
||||||
reader.
|
executing any other commands or starting the interactive reader.
|
||||||
|
|
||||||
|
Alternatively, a configuration file can be explicitly specified with the
|
||||||
|
\fB-C\fR option.
|
||||||
.SH COMMAND-LINE OPTIONS
|
.SH COMMAND-LINE OPTIONS
|
||||||
Command-line options accepted by MSPDebug are described below. If
|
Command-line options accepted by MSPDebug are described below. If
|
||||||
commands are specified on the end of the command-line, then they are
|
commands are specified on the end of the command-line, then they are
|
||||||
|
|
12
ui/main.c
12
ui/main.c
|
@ -152,15 +152,19 @@ static void process_rc_file(const char *config)
|
||||||
char text[256];
|
char text[256];
|
||||||
|
|
||||||
if (!config) {
|
if (!config) {
|
||||||
|
if (!access(".mspdebug", F_OK)) {
|
||||||
|
config = ".mspdebug";
|
||||||
|
} else {
|
||||||
const char *home = getenv("HOME");
|
const char *home = getenv("HOME");
|
||||||
|
|
||||||
if (!home)
|
if (home) {
|
||||||
return;
|
snprintf(text, sizeof(text), "%s/.mspdebug",
|
||||||
|
home);
|
||||||
snprintf(text, sizeof(text), "%s/.mspdebug", home);
|
|
||||||
if (!access(text, F_OK))
|
if (!access(text, F_OK))
|
||||||
config = text;
|
config = text;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (config)
|
if (config)
|
||||||
process_file(config, 0);
|
process_file(config, 0);
|
||||||
|
|
Loading…
Reference in New Issue