Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
3fe110d3
Commit
3fe110d3
authored
Nov 21, 2018
by
Paul Eggert
Browse files
emacsclient: improve use of locals
* lib-src/emacsclient.c (main): Use smaller scopes for some locals.
parent
7a85a40e
Pipeline
#110
failed with stage
in 21 minutes and 38 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
lib-src/emacsclient.c
lib-src/emacsclient.c
+6
-7
No files found.
lib-src/emacsclient.c
View file @
3fe110d3
...
...
@@ -1610,7 +1610,6 @@ main (int argc, char **argv)
{
int
rl
=
0
;
bool
skiplf
=
true
;
char
*
cwd
,
*
str
;
char
string
[
BUFSIZ
+
1
];
int
exit_status
=
EXIT_SUCCESS
;
...
...
@@ -1660,7 +1659,7 @@ main (int argc, char **argv)
start_daemon_and_retry_set_socket
();
}
cwd
=
get_current_dir_name
();
char
*
cwd
=
get_current_dir_name
();
if
(
cwd
==
0
)
{
message
(
true
,
"%s: %s
\n
"
,
progname
,
...
...
@@ -1803,10 +1802,10 @@ main (int argc, char **argv)
else
if
(
eval
)
{
/* Read expressions interactively. */
while
(
(
str
=
fgets
(
string
,
BUFSIZ
,
stdin
))
)
while
(
fgets
(
string
,
BUFSIZ
,
stdin
))
{
send_to_emacs
(
emacs_socket
,
"-eval "
);
quote_argument
(
emacs_socket
,
str
);
quote_argument
(
emacs_socket
,
str
ing
);
}
send_to_emacs
(
emacs_socket
,
" "
);
}
...
...
@@ -1876,7 +1875,7 @@ main (int argc, char **argv)
/* -print STRING: Print STRING on the terminal. */
if
(
!
suppress_output
)
{
str
=
unquote_argument
(
p
+
strlen
(
"-print "
));
char
*
str
=
unquote_argument
(
p
+
strlen
(
"-print "
));
printf
(
&
"
\n
%s"
[
skiplf
],
str
);
if
(
str
[
0
])
skiplf
=
str
[
strlen
(
str
)
-
1
]
==
'\n'
;
...
...
@@ -1888,7 +1887,7 @@ main (int argc, char **argv)
Used to continue a preceding -print command. */
if
(
!
suppress_output
)
{
str
=
unquote_argument
(
p
+
strlen
(
"-print-nonl "
));
char
*
str
=
unquote_argument
(
p
+
strlen
(
"-print-nonl "
));
printf
(
"%s"
,
str
);
if
(
str
[
0
])
skiplf
=
str
[
strlen
(
str
)
-
1
]
==
'\n'
;
...
...
@@ -1897,7 +1896,7 @@ main (int argc, char **argv)
else
if
(
strprefix
(
"-error "
,
p
))
{
/* -error DESCRIPTION: Signal an error on the terminal. */
str
=
unquote_argument
(
p
+
strlen
(
"-error "
));
char
*
str
=
unquote_argument
(
p
+
strlen
(
"-error "
));
if
(
!
skiplf
)
printf
(
"
\n
"
);
fprintf
(
stderr
,
"*ERROR*: %s"
,
str
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment