File: code.txt

package info (click to toggle)
fonts-agave 37-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,060 kB
  • sloc: tcl: 422; xml: 18; sh: 5; makefile: 4
file content (39 lines) | stat: -rw-r--r-- 632 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* openbsd's bin/echo/echo.c
 *
 * Copyright (c) 1989, 1993
 *   The Regents of the University of California.
 *   All rights reserved.
 */

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <err.h>

/* ARGSUSED */
int
main(int argc, char *argv[])
{
  int nflag;

  if (pledge("stdio", NULL) == -1)
    err(1, "pledge");

  /* This utility may NOT do getopt(3) option parsing. */
  if (*++argv && !strcmp(*argv, "-n")) {
    ++argv;
    nflag = 1;
  }
  else
    nflag = 0;

  while (*argv) {
    (void)fputs(*argv, stdout);
    if (*++argv)
      putchar(' ');
  }
  if (!nflag)
    putchar('\n');

  return 0;
}