- msgp->mtext[0] = 0;
- used = 0;
-
- if (nowait)
- {
- strcat (msgp->mtext, "-nowait ");
- used += 8;
- }
-
- argc -= optind;
- argv += optind;
-
- while (argc)
- {
- int need_cwd = 0;
- char *modified_arg = argv[0];
-
- if (*modified_arg == '+')
- {
- char *p = modified_arg + 1;
- while (isdigit (*p) || *p == ':')
- p++;
- if (*p != 0)
- need_cwd = 1;
- }
- else if (*modified_arg != '/')
- need_cwd = 1;
-
- modified_arg = quote_file_name (modified_arg);
-
- if (need_cwd)
- /* Overestimate in case we have to quote something in CWD. */
- used += 2 * strlen (cwd);
- used += strlen (modified_arg) + 1;
- while (used + 2 > size_allocated)
- {
- size_allocated *= 2;
- msgp = (struct msgbuf *) realloc (msgp,
- (sizeof (struct msgbuf)
- + size_allocated));
- }
-
- if (need_cwd)
- strcat (msgp->mtext, quote_file_name (cwd));
-
- strcat (msgp->mtext, modified_arg);
- strcat (msgp->mtext, " ");
- argv++; argc--;
- }
- strcat (msgp->mtext, "\n");
-#ifdef HPUX /* HPUX has a bug. */
- if (strlen (msgp->mtext) >= 512)
- {
- fprintf (stderr, "%s: args too long for msgsnd\n", progname);
- fail (argc, argv);
- }
-#endif
- msgp->mtype = 1;
- if (msgsnd (s, msgp, strlen (msgp->mtext)+1, 0) < 0)