Better to just statically set the name vs. determine at run time.

This commit is contained in:
David E. O'Brien 2008-05-11 17:23:57 +00:00
parent e28d949ff4
commit 1ff2ab846d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=178946
12 changed files with 16 additions and 12 deletions

View File

@ -182,7 +182,7 @@ configFstab(dialogMenuItem *self)
else {
msgConfirm("Attempting to rebuild your /etc/fstab file. Warning: If you had\n"
"any CD devices in use before running %s then they may NOT\n"
"be found by this run!", StartName);
"be found by this run!", ProgName);
}
devs = deviceFind(NULL, DEVICE_TYPE_DISK);

View File

@ -1276,7 +1276,7 @@ diskLabel(Device *dev)
if (!variable_cmp(DISK_LABELLED, "written")) {
msgConfirm("You've already written out your changes - if you\n"
"wish to overwrite them, you'll have to restart\n"
"%s first.", StartName);
"%s first.", ProgName);
}
else if (!msgNoYes("WARNING: You are about to modify an EXISTING\n"
"installation.\n\n"

View File

@ -34,6 +34,7 @@
#include <sys/fcntl.h>
const char *StartName; /* Initial contents of argv[0] */
const char *ProgName = "sade";
int
main(int argc, char **argv)

View File

@ -278,6 +278,7 @@ extern DMenu MenuMBRType; /* Type of MBR to write on the disk */
extern DMenu MenuMain; /* New main menu */
extern DMenu MenuDiskDevices; /* Disk type devices */
extern const char * StartName; /* Which name we were started as */
extern const char * ProgName; /* Program's proper name */
/* Important chunks. */
extern Chunk *HomeChunk;

View File

@ -233,11 +233,11 @@ systemHelpFile(char *file, char *buf)
snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT", file);
if (file_readable(buf))
return expand(buf);
snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/%s/help/%s.hlp", StartName,
snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/%s/help/%s.hlp", ProgName,
file);
if (file_readable(buf))
return buf;
snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/%s/help/%s.TXT", StartName,
snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/%s/help/%s.TXT", ProgName,
file);
if (file_readable(buf))
return buf;

View File

@ -238,12 +238,12 @@ dump_variables(dialogMenuItem *unused)
Variable *vp;
if (isDebug())
msgDebug("Writing %s variables to file..\n", StartName);
msgDebug("Writing %s variables to file..\n", ProgName);
fp = fopen("/etc/sade.vars", "w");
if (!fp) {
msgConfirm("Unable to write to /etc/%s.vars: %s",
StartName, strerror(errno));
ProgName, strerror(errno));
return DITEM_FAILURE;
}

View File

@ -188,7 +188,7 @@ configFstab(dialogMenuItem *self)
else {
msgConfirm("Attempting to rebuild your /etc/fstab file. Warning: If you had\n"
"any CD devices in use before running %s then they may NOT\n"
"be found by this run!", StartName);
"be found by this run!", ProgName);
}
}

View File

@ -1281,7 +1281,7 @@ diskLabel(Device *dev)
if (!variable_cmp(DISK_LABELLED, "written")) {
msgConfirm("You've already written out your changes - if you\n"
"wish to overwrite them, you'll have to restart\n"
"%s first.", StartName);
"%s first.", ProgName);
}
else if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n"
"installation. If you are installing FreeBSD for the first time\n"

View File

@ -41,6 +41,7 @@
#include <sys/resource.h>
const char *StartName; /* Initial contents of argv[0] */
const char *ProgName = "sysinstall";
static void
screech(int sig)

View File

@ -479,6 +479,7 @@ extern DMenu MenuUsermgmt; /* User management menu */
extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */
extern int FixItMode; /* FixItMode starts shell on current device (ie Serial port) */
extern const char * StartName; /* Which name we were started as */
extern const char * ProgName; /* Program's proper name */
extern int NCpus; /* # cpus on machine */
/* Important chunks. */

View File

@ -365,11 +365,11 @@ systemHelpFile(char *file, char *buf)
snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT", file);
if (file_readable(buf))
return expand(buf);
snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/%s/help/%s.hlp", StartName,
snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/%s/help/%s.hlp", ProgName,
file);
if (file_readable(buf))
return buf;
snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/%s/help/%s.TXT", StartName,
snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/%s/help/%s.TXT", ProgName,
file);
if (file_readable(buf))
return buf;

View File

@ -243,12 +243,12 @@ dump_variables(dialogMenuItem *unused)
Variable *vp;
if (isDebug())
msgDebug("Writing %s variables to file..\n", StartName);
msgDebug("Writing %s variables to file..\n", ProgName);
fp = fopen("/etc/sysinstall.vars", "w");
if (!fp) {
msgConfirm("Unable to write to /etc/%s.vars: %s",
StartName, strerror(errno));
ProgName, strerror(errno));
return DITEM_FAILURE;
}