[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lib-src/emacsclient.c
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] Changes to emacs/lib-src/emacsclient.c |
Date: |
Sun, 28 Sep 2003 04:24:57 -0400 |
Index: emacs/lib-src/emacsclient.c
diff -c emacs/lib-src/emacsclient.c:1.62 emacs/lib-src/emacsclient.c:1.63
*** emacs/lib-src/emacsclient.c:1.62 Fri Sep 19 10:27:47 2003
--- emacs/lib-src/emacsclient.c Sun Sep 28 04:24:56 2003
***************
*** 169,182 ****
exit (0);
}
! /* Return a copy of NAME, inserting a &
before each &, each space, each newline, and any initial -.
Change spaces to underscores, too, so that the
return value never contains a space. */
! char *
! quote_file_name (name)
char *name;
{
char *copy = (char *) malloc (strlen (name) * 2 + 1);
char *p, *q;
--- 169,183 ----
exit (0);
}
! /* Inserting a &
before each &, each space, each newline, and any initial -.
Change spaces to underscores, too, so that the
return value never contains a space. */
! void
! quote_file_name (name, stream)
char *name;
+ FILE *stream;
{
char *copy = (char *) malloc (strlen (name) * 2 + 1);
char *p, *q;
***************
*** 206,212 ****
}
*q++ = 0;
! return copy;
}
/* Like malloc but get fatal error if memory is exhausted. */
--- 207,215 ----
}
*q++ = 0;
! fprintf (stream, copy);
!
! free (copy);
}
/* Like malloc but get fatal error if memory is exhausted. */
***************
*** 310,316 ****
/* Process options. */
decode_options (argc, argv);
! if (argc - optind < 1)
{
fprintf (stderr, "%s: file name or argument required\n", progname);
fprintf (stderr, "Try `%s --help' for more information\n", progname);
--- 313,319 ----
/* Process options. */
decode_options (argc, argv);
! if ((argc - optind < 1) && !eval)
{
fprintf (stderr, "%s: file name or argument required\n", progname);
fprintf (stderr, "Try `%s --help' for more information\n", progname);
***************
*** 476,499 ****
fprintf (out, "-eval ");
if (display)
! fprintf (out, "-display %s ", quote_file_name (display));
! for (i = optind; i < argc; i++)
{
! if (eval)
! ; /* Don't prepend any cwd or anything like that. */
! else if (*argv[i] == '+')
{
! char *p = argv[i] + 1;
! while (isdigit ((unsigned char) *p) || *p == ':') p++;
! if (*p != 0)
! fprintf (out, "%s/", quote_file_name (cwd));
! }
! else if (*argv[i] != '/')
! fprintf (out, "%s/", quote_file_name (cwd));
! fprintf (out, "%s ", quote_file_name (argv[i]));
}
fprintf (out, "\n");
fflush (out);
--- 479,525 ----
fprintf (out, "-eval ");
if (display)
! {
! fprintf (out, "-display ");
! quote_file_name (display, out);
! fprintf (out, " ");
! }
! if ((argc - optind > 0))
{
! for (i = optind; i < argc; i++)
{
! if (eval)
! ; /* Don't prepend any cwd or anything like that. */
! else if (*argv[i] == '+')
! {
! char *p = argv[i] + 1;
! while (isdigit ((unsigned char) *p) || *p == ':') p++;
! if (*p != 0)
! {
! quote_file_name (cwd, out);
! fprintf (out, "/");
! }
! }
! else if (*argv[i] != '/')
! {
! quote_file_name (cwd, out);
! fprintf (out, "/");
! }
! quote_file_name (argv[i], out);
! fprintf (out, " ");
! }
! }
! else
! {
! while ((str = fgets (string, BUFSIZ, stdin)))
! {
! quote_file_name (str, out);
! }
! fprintf (out, " ");
}
+
fprintf (out, "\n");
fflush (out);