mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Fixed wrong comparison
SVN revision: 1579
This commit is contained in:
parent
d7ad12c511
commit
be1f4fe7ac
@ -103,6 +103,7 @@ typedef int BOOL;
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
#include <pty.h>
|
||||||
|
|
||||||
#define closesocket(s) close(s)
|
#define closesocket(s) close(s)
|
||||||
|
|
||||||
@ -1049,10 +1050,16 @@ int subst_shell(char *cmd, char *result, int size)
|
|||||||
i = read(pipe, buffer, sizeof(buffer));
|
i = read(pipe, buffer, sizeof(buffer));
|
||||||
if (i <= 0)
|
if (i <= 0)
|
||||||
break;
|
break;
|
||||||
|
buffer[i] = 0;
|
||||||
strlcat(result, buffer, size);
|
strlcat(result, buffer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
|
/* strip trailing CR/LF */
|
||||||
|
while (strlen(result) > 0 && (result[strlen(result)-1] == '\r' || result[strlen(result)-1] == '\n'))
|
||||||
|
result[strlen(result)-1] = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* child process */
|
/* child process */
|
||||||
|
|
||||||
@ -1106,7 +1113,7 @@ void strsubst_list(char *string, int size, char name[][NAME_LENGTH], char value[
|
|||||||
ps = strchr(ps, ')')+1;
|
ps = strchr(ps, ')')+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (str[6] = '"') {
|
if (str[6] == '"') {
|
||||||
strcpy(str, p+7);
|
strcpy(str, p+7);
|
||||||
if (strrchr(str, '\"'))
|
if (strrchr(str, '\"'))
|
||||||
*strrchr(str, '\"') = 0;
|
*strrchr(str, '\"') = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user