+\f
+/* Handle the "debug" command which is documented to take multiple
+ arguments. This is also called by the ``debug'' command in a sys
+ file. It returns a CMDTABRET code. This should probably be in its
+ own file, but the only other place it is called is from tsinfo.c,
+ and any user of tsinfo.c it sure to link in this file as well. */
+
+int
+_uuconf_idebug_cmd (qglobal, pzdebug, argc, argv, pblock)
+ struct sglobal *qglobal;
+ char **pzdebug;
+ int argc;
+ char **argv;
+ pointer pblock;
+{
+ if (argc == 1)
+ {
+ *pzdebug = NULL;
+ return UUCONF_CMDTABRET_CONTINUE;
+ }
+ else if (argc == 2)
+ {
+ *pzdebug = argv[1];
+ return UUCONF_CMDTABRET_KEEP;
+ }
+ else
+ {
+ size_t cdebug;
+ int i;
+ char *zdebug;
+
+ cdebug = 0;
+ for (i = 1; i < argc; i++)
+ cdebug += strlen (argv[i]) + 1;
+ zdebug = (char *) uuconf_malloc (pblock, cdebug);
+ if (zdebug == NULL)
+ {
+ qglobal->ierrno = errno;
+ return (UUCONF_MALLOC_FAILED
+ | UUCONF_ERROR_ERRNO
+ | UUCONF_CMDTABRET_EXIT);
+ }
+ cdebug = 0;
+ for (i = 1; i < argc; i++)
+ {
+ size_t clen;
+
+ clen = strlen (argv[i]);
+ memcpy (zdebug + cdebug, argv[i], clen);
+ zdebug[cdebug + clen] = ' ';
+ cdebug += clen + 1;
+ }
+ zdebug[cdebug - 1] = '\0';
+ *pzdebug = zdebug;
+ return UUCONF_CMDTABRET_CONTINUE;
+ }
+}