]> code.delx.au - gnu-emacs/blobdiff - src/process.c
Spelling fixes.
[gnu-emacs] / src / process.c
index 41ca66671a9af969b8026bc20e81dd5ac088148b..0c36f8e18c317806c98127da179cef41bf4d09f6 100644 (file)
@@ -596,7 +596,7 @@ status_message (struct Lisp_Process *p)
   Lisp_Object symbol;
   int code;
   bool coredump;
-  Lisp_Object string, string2;
+  Lisp_Object string;
 
   decode_status (status, &symbol, &code, &coredump);
 
@@ -620,8 +620,8 @@ status_message (struct Lisp_Process *p)
          if (c1 != c2)
            Faset (string, make_number (0), make_number (c2));
        }
-      string2 = build_local_string (coredump ? " (core dumped)\n" : "\n");
-      return concat2 (string, string2);
+      AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n");
+      return concat2 (string, suffix);
     }
   else if (EQ (symbol, Qexit))
     {
@@ -629,17 +629,17 @@ status_message (struct Lisp_Process *p)
        return build_string (code == 0 ? "deleted\n" : "connection broken by remote peer\n");
       if (code == 0)
        return build_string ("finished\n");
+      AUTO_STRING (prefix, "exited abnormally with code ");
       string = Fnumber_to_string (make_number (code));
-      string2 = build_local_string (coredump ? " (core dumped)\n" : "\n");
-      return concat3 (build_local_string ("exited abnormally with code "),
-                     string, string2);
+      AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n");
+      return concat3 (prefix, string, suffix);
     }
   else if (EQ (symbol, Qfailed))
     {
+      AUTO_STRING (prefix, "failed with code ");
       string = Fnumber_to_string (make_number (code));
-      string2 = build_local_string ("\n");
-      return concat3 (build_string ("failed with code "),
-                     string, string2);
+      AUTO_STRING (suffix, "\n");
+      return concat3 (prefix, string, suffix);
     }
   else
     return Fcopy_sequence (Fsymbol_name (symbol));
@@ -1302,30 +1302,34 @@ Returns nil if format of ADDRESS is invalid.  */)
       ptrdiff_t size = p->header.size;
       Lisp_Object args[10];
       int nargs, i;
+      char const *format;
 
       if (size == 4 || (size == 5 && !NILP (omit_port)))
        {
-         args[0] = build_local_string ("%d.%d.%d.%d");
+         format = "%d.%d.%d.%d";
          nargs = 4;
        }
       else if (size == 5)
        {
-         args[0] = build_local_string ("%d.%d.%d.%d:%d");
+         format = "%d.%d.%d.%d:%d";
          nargs = 5;
        }
       else if (size == 8 || (size == 9 && !NILP (omit_port)))
        {
-         args[0] = build_local_string ("%x:%x:%x:%x:%x:%x:%x:%x");
+         format = "%x:%x:%x:%x:%x:%x:%x:%x";
          nargs = 8;
        }
       else if (size == 9)
        {
-         args[0] = build_local_string ("[%x:%x:%x:%x:%x:%x:%x:%x]:%d");
+         format = "[%x:%x:%x:%x:%x:%x:%x:%x]:%d";
          nargs = 9;
        }
       else
        return Qnil;
 
+      AUTO_STRING (format_obj, format);
+      args[0] = format_obj;
+
       for (i = 0; i < nargs; i++)
        {
          if (! RANGED_INTEGERP (0, p->contents[i], 65535))
@@ -1343,8 +1347,10 @@ Returns nil if format of ADDRESS is invalid.  */)
     }
 
   if (CONSP (address))
-    return Fformat (2, ((Lisp_Object [])
-      { build_local_string ("<Family %d>"), Fcar (address) }));
+    {
+      AUTO_STRING (format, "<Family %d>");
+      return Fformat (2, (Lisp_Object []) {format, Fcar (address)});
+    }
 
   return Qnil;
 }
@@ -2989,7 +2995,7 @@ usage: (make-network-process &rest ARGS)  */)
       address_un.sun_family = AF_LOCAL;
       if (sizeof address_un.sun_path <= SBYTES (service))
        error ("Service name too long");
-      strcpy (address_un.sun_path, SSDATA (service));
+      lispstpcpy (address_un.sun_path, service);
       ai.ai_addr = (struct sockaddr *) &address_un;
       ai.ai_addrlen = sizeof address_un;
       goto open_socket;
@@ -3680,7 +3686,7 @@ network_interface_info (Lisp_Object ifname)
 
   if (sizeof rq.ifr_name <= SBYTES (ifname))
     error ("interface name too long");
-  strcpy (rq.ifr_name, SSDATA (ifname));
+  lispstpcpy (rq.ifr_name, ifname);
 
   s = socket (AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
   if (s < 0)
@@ -4059,12 +4065,13 @@ server_accept_connection (Lisp_Object server, int channel)
       {
        unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr;
 
+       AUTO_STRING (ipv4_format, "%d.%d.%d.%d");
        host = Fformat (5, ((Lisp_Object [])
-         { build_local_string ("%d.%d.%d.%d"), make_number (*ip++),
-           make_number (*ip++), make_number (*ip++), make_number (*ip++) }));
+         { ipv4_format, make_number (ip[0]),
+           make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) }));
        service = make_number (ntohs (saddr.in.sin_port));
-       caller = Fformat (3, ((Lisp_Object [])
-         { build_local_string (" <%s:%d>"), host, service }));
+       AUTO_STRING (caller_format, " <%s:%d>");
+       caller = Fformat (3, (Lisp_Object []) {caller_format, host, service});
       }
       break;
 
@@ -4075,13 +4082,14 @@ server_accept_connection (Lisp_Object server, int channel)
        uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr;
        int i;
 
-       args[0] = build_local_string ("%x:%x:%x:%x:%x:%x:%x:%x");
+       AUTO_STRING (ipv6_format, "%x:%x:%x:%x:%x:%x:%x:%x");
+       args[0] = ipv6_format;
        for (i = 0; i < 8; i++)
          args[i + 1] = make_number (ntohs (ip6[i]));
        host = Fformat (9, args);
        service = make_number (ntohs (saddr.in.sin_port));
-       caller = Fformat (3, ((Lisp_Object [])
-         { build_local_string (" <[%s]:%d>"), host, service }));
+       AUTO_STRING (caller_format, " <[%s]:%d>");
+       caller = Fformat (3, (Lisp_Object []) {caller_format, host, service});
       }
       break;
 #endif
@@ -4091,8 +4099,9 @@ server_accept_connection (Lisp_Object server, int channel)
 #endif
     default:
       caller = Fnumber_to_string (make_number (connect_counter));
-      caller = concat3
-       (build_local_string (" <"), caller, build_local_string (">"));
+      AUTO_STRING (space_less_than, " <");
+      AUTO_STRING (greater_than, ">");
+      caller = concat3 (space_less_than, caller, greater_than);
       break;
     }
 
@@ -4189,16 +4198,18 @@ server_accept_connection (Lisp_Object server, int channel)
   p->inherit_coding_system_flag
     = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag);
 
+  AUTO_STRING (dash, "-");
+  AUTO_STRING (nl, "\n");
+  Lisp_Object host_string = STRINGP (host) ? host : dash;
+
   if (!NILP (ps->log))
-      call3 (ps->log, server, proc,
-            concat3 (build_local_string ("accept from "),
-                     (STRINGP (host) ? host : build_local_string ("-")),
-                     build_local_string ("\n")));
-
-  exec_sentinel (proc,
-                concat3 (build_local_string ("open from "),
-                         (STRINGP (host) ? host : build_local_string ("-")),
-                         build_local_string ("\n")));
+    {
+      AUTO_STRING (accept_from, "accept from ");
+      call3 (ps->log, server, proc, concat3 (accept_from, host_string, nl));
+    }
+
+  AUTO_STRING (open_from, "open from ");
+  exec_sentinel (proc, concat3 (open_from, host_string, nl));
 }
 
 /* This variable is different from waiting_for_input in keyboard.c.