Fixed mbsetup '%' output
This commit is contained in:
parent
0c57e334fd
commit
4a4154acc0
@ -4310,6 +4310,8 @@ v0.33.19 26-Oct-2001
|
||||
Rewrote calling of the color editor for Sparc systems.
|
||||
Added setup items in global and message areas to limit the
|
||||
fetching of newsgroups headers.
|
||||
The edit field now shows the contents correctly if the field
|
||||
contains the % character.
|
||||
|
||||
mbsebbs:
|
||||
Added menu 317, change FS editor shortcut keys to (Emacs/
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Mangle a unix name to DOS 8.3 filename
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2001
|
||||
* Copyright (C) 1997-2002
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -391,7 +391,7 @@ void mangle_name_83(char *s)
|
||||
for (i = 0; i < strlen(q); i++)
|
||||
*p++ = q[i];
|
||||
*p++ = '\0';
|
||||
Syslog('f', "name with new extension => \"%s\"", s);
|
||||
// Syslog('f', "name with new extension => \"%s\"", s);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -474,7 +474,7 @@ void name_mangle(char *OutName)
|
||||
tu(OutName);
|
||||
}
|
||||
|
||||
Syslog('f',"name_mangle(%s) ==> [%s]", p, OutName);
|
||||
// Syslog('f',"name_mangle(%s) ==> [%s]", p, OutName);
|
||||
free(p);
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ int Magics = 0; /* Processed magics */
|
||||
char *Magic_Macro(int);
|
||||
char *Magic_Macro(int C)
|
||||
{
|
||||
static char buf[81];
|
||||
static char buf[PATH_MAX];
|
||||
|
||||
buf[0] = '\0';
|
||||
switch(toupper(C)) {
|
||||
@ -197,6 +197,7 @@ void MagicResult(char *format, ...)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Magic_CheckCompile(void);
|
||||
void Magic_CheckCompile(void)
|
||||
{
|
||||
@ -224,7 +225,7 @@ void Magic_ExecCommand(void)
|
||||
{
|
||||
int i, j, k, Err, First = TRUE;
|
||||
char Line[256];
|
||||
char Temp[81];
|
||||
char Temp[PATH_MAX];
|
||||
char *cmd, *opts;
|
||||
|
||||
while (GetMagicRec(MG_EXEC, First)) {
|
||||
@ -273,8 +274,8 @@ void Magic_CopyFile(void)
|
||||
int First = TRUE;
|
||||
char *From, *To;
|
||||
|
||||
From = calloc(256, sizeof(char));
|
||||
To = calloc(256, sizeof(char));
|
||||
From = calloc(PATH_MAX, sizeof(char));
|
||||
To = calloc(PATH_MAX, sizeof(char));
|
||||
|
||||
while (GetMagicRec(MG_COPY, First)) {
|
||||
First = FALSE;
|
||||
@ -296,38 +297,38 @@ void Magic_CopyFile(void)
|
||||
|
||||
void Magic_UnpackFile(void)
|
||||
{
|
||||
int rc, First = TRUE;
|
||||
char *buf = NULL, *unarc = NULL, *cmd = NULL;
|
||||
char Fn[128];
|
||||
int rc, First = TRUE;
|
||||
char *buf = NULL, *unarc = NULL, *cmd = NULL;
|
||||
char Fn[PATH_MAX];
|
||||
|
||||
while (GetMagicRec(MG_UNPACK, First)) {
|
||||
First = FALSE;
|
||||
buf = calloc(PATH_MAX, sizeof(char)); /* 06-01-2001 MB. Test if NULL pointer free'd message goes away */
|
||||
getcwd(buf, 128);
|
||||
while (GetMagicRec(MG_UNPACK, First)) {
|
||||
First = FALSE;
|
||||
buf = calloc(PATH_MAX, sizeof(char));
|
||||
getcwd(buf, 128);
|
||||
|
||||
if (chdir(magic.Path) == 0) {
|
||||
sprintf(Fn, "%s/%s", TIC.BBSpath, TIC.NewName);
|
||||
if ((unarc = unpacker(Fn)) != NULL) {
|
||||
if (getarchiver(unarc)) {
|
||||
cmd = xstrcpy(archiver.funarc);
|
||||
if (strlen(cmd)) {
|
||||
rc = execute(cmd, Fn, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null");
|
||||
if (rc)
|
||||
WriteError("$Magic: unpack in %s, error %d", magic.Path, rc);
|
||||
else
|
||||
MagicResult((char *)"unpacked in %s", magic.Path);
|
||||
}
|
||||
free(cmd);
|
||||
}
|
||||
}
|
||||
if (chdir(magic.Path) == 0) {
|
||||
sprintf(Fn, "%s/%s", TIC.BBSpath, TIC.NewName);
|
||||
if ((unarc = unpacker(Fn)) != NULL) {
|
||||
if (getarchiver(unarc)) {
|
||||
cmd = xstrcpy(archiver.funarc);
|
||||
if (strlen(cmd)) {
|
||||
rc = execute(cmd, Fn, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null");
|
||||
if (rc)
|
||||
WriteError("$Magic: unpack in %s, error %d", magic.Path, rc);
|
||||
else
|
||||
MagicResult((char *)"unpacked in %s", magic.Path);
|
||||
}
|
||||
free(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
chdir(buf);
|
||||
Magic_CheckCompile();
|
||||
} else
|
||||
WriteError("$Magic: unpack: can't chdir \"%s\"", magic.Path);
|
||||
chdir(buf);
|
||||
Magic_CheckCompile();
|
||||
} else
|
||||
WriteError("$Magic: unpack: can't chdir \"%s\"", magic.Path);
|
||||
|
||||
free(buf);
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -358,7 +359,7 @@ void Magic_AdoptFile(void)
|
||||
char *temp;
|
||||
FILE *Tf;
|
||||
|
||||
temp = calloc(256, sizeof(char));
|
||||
temp = calloc(PATH_MAX, sizeof(char));
|
||||
|
||||
while (GetMagicRec(MG_ADOPT, First)) {
|
||||
First = FALSE;
|
||||
|
@ -200,7 +200,7 @@ int LoadTic(char *inb, char *tfn)
|
||||
}
|
||||
Temp[j] = '\0';
|
||||
|
||||
Syslog('f', "TIC: %s", Temp);
|
||||
// Syslog('f', "TIC: %s", Temp);
|
||||
if (strncasecmp(Temp, "hatch", 5) == 0) {
|
||||
TIC.TicIn.Hatch = TRUE;
|
||||
|
||||
|
@ -94,9 +94,19 @@ void errmsg(const char *format, ...)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Safe field display, does not format % characters but displays it.
|
||||
*/
|
||||
void show_field(int y, int x, char *str, int length, int fill)
|
||||
{
|
||||
mvprintw(y, x, padleft(str, length, fill));
|
||||
int i;
|
||||
|
||||
locate(y, x);
|
||||
for (i = 0; i < strlen(str); i++)
|
||||
putchar(str[i]);
|
||||
if (strlen(str) < length)
|
||||
for (i = strlen(str); i < length; i++)
|
||||
putchar(fill);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user