aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-24 20:06:31 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-24 20:06:31 +0000
commitb827dbee0b51ff7fae6ed717fdcd2dfa856869c4 (patch)
tree606c275291dbb3031e5c026debf7e36cee62ec08 /main/asterisk.c
parent2f807ff4b9c932ec93a374990544b6c01fa7e844 (diff)
Merged revisions 71358 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r71358 | russell | 2007-06-24 15:04:21 -0500 (Sun, 24 Jun 2007) | 2 lines Revert the patch from issue 9654 due to an unexpected side effect ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@71362 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index d0c3d2e4e..0c36fda6a 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -2282,9 +2282,6 @@ static void ast_remotecontrol(char * data)
for (;;) {
ebuf = (char *)el_gets(el, &num);
- if (!ebuf)
- break;
-
if (!ast_strlen_zero(ebuf)) {
if (ebuf[strlen(ebuf)-1] == '\n')
ebuf[strlen(ebuf)-1] = '\0';
@@ -2959,14 +2956,12 @@ int main(int argc, char *argv[])
for (;;) {
buf = (char *)el_gets(el, &num);
- if (!buf)
- break;
-
- if (buf[strlen(buf)-1] == '\n')
- buf[strlen(buf)-1] = '\0';
- consolehandler((char *)buf);
+ if (buf) {
+ if (buf[strlen(buf)-1] == '\n')
+ buf[strlen(buf)-1] = '\0';
- if (!buf && ast_opt_remote && (write(STDOUT_FILENO, "\nUse EXIT or QUIT to exit the asterisk console\n",
+ consolehandler((char *)buf);
+ } else if (ast_opt_remote && (write(STDOUT_FILENO, "\nUse EXIT or QUIT to exit the asterisk console\n",
strlen("\nUse EXIT or QUIT to exit the asterisk console\n")) < 0)) {
/* Whoa, stdout disappeared from under us... Make /dev/null's */
int fd;