Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-8081-

Theo de Raadt

Name: Anonymous 2011-01-06 11:59


/*    $OpenBSD: echo.c,v 1.7 2009/10/27 23:59:21 deraadt Exp $    */
/*    $NetBSD: echo.c,v 1.6 1995/03/21 09:04:27 cgd Exp $    */

/*
 * Copyright (c) 1989, 1993
 *    The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* ARGSUSED */
int
main( /* it's fucking unused, theo*/ int argc, char *argv[])
{
    int nflag; /* it's a fucking boolean, theo*/

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

    while (*argv /*it's not a fucking boolean, theo*/ ) {
        (void)fputs(*argv, stdout);
        if (*++argv /*it's not a fucking boolean, theo*/)
            putchar(' '); /*unused return result, theo*/
    }
    if (!nflag)
        putchar('\n'); /*unused return result, theo*/

    return 0; /* not a exit status macro, theo*/
}



Our efforts emphasize _portability_, _standardization_, _correctness_, proactive security and integrated cryptography.

Name: Anonymous 2011-01-06 12:03

There is no boolean type in C. All integer and pointer types can be evaluated in boolean operations. A null pointer is false, a non-null pointer is true. strcmp returns 0 when strings are equal, and !0 is equal to 1 which is true.

The more you know.

Name: Anonymous 2011-01-06 12:08

>>1
You're not man enough to code C like that.

Name: Anonymous 2011-01-06 12:18

what spastic wrote these comments

Name: Anonymous 2011-01-06 12:22

>>4
OP did, while have a few cocks in his mouth.

Name: Anonymous 2011-01-06 12:56

>>1
0/10

Name: Anonymous 2011-01-06 13:36

>>1
What's with that toy code?
Here's a real implementation of echo.

/* echo.c, derived from code echo.c in Bash.
   Copyright (C) 1987, 1989, 1991-1997, 1999-2005, 2007-2010 Free Software
   Foundation, Inc.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>;.  */

#include <config.h>
#include <stdio.h>
#include <sys/types.h>
#include "system.h"

/* The official name of this program (e.g., no `g' prefix).  */
#define PROGRAM_NAME "echo"

#define AUTHORS \
  proper_name ("Brian Fox"), \
  proper_name ("Chet Ramey")

/* If true, interpret backslash escapes by default.  */
#ifndef DEFAULT_ECHO_TO_XPG
enum { DEFAULT_ECHO_TO_XPG = false };
#endif

void
usage (int status)
{
  if (status != EXIT_SUCCESS)
    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
  else
    {
      printf (_("\
Usage: %s [SHORT-OPTION]... [STRING]...\n\
  or:  %s LONG-OPTION\n\
"), program_name, program_name);
      fputs (_("\
Echo the STRING(s) to standard output.\n\
\n\
  -n             do not output the trailing newline\n\
"), stdout);
      fputs (_(DEFAULT_ECHO_TO_XPG
               ? N_("\
  -e             enable interpretation of backslash escapes (default)\n\
  -E             disable interpretation of backslash escapes\n")
               : N_("\
  -e             enable interpretation of backslash escapes\n\
  -E             disable interpretation of backslash escapes (default)\n")),
             stdout);
      fputs (HELP_OPTION_DESCRIPTION, stdout);
      fputs (VERSION_OPTION_DESCRIPTION, stdout);
      fputs (_("\
\n\
If -e is in effect, the following sequences are recognized:\n\
\n\
"), stdout);
      fputs (_("\
  \\\\      backslash\n\
  \\a      alert (BEL)\n\
  \\b      backspace\n\
  \\c      produce no further output\n\
  \\e      escape\n\
  \\f      form feed\n\
  \\n      new line\n\
  \\r      carriage return\n\
  \\t      horizontal tab\n\
  \\v      vertical tab\n\
"), stdout);
      fputs (_("\
  \\0NNN   byte with octal value NNN (1 to 3 digits)\n\
  \\xHH    byte with hexadecimal value HH (1 to 2 digits)\n\
"), stdout);
      printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
      emit_ancillary_info ();
    }
  exit (status);
}

/* Convert C from hexadecimal character to integer.  */
static int
hextobin (unsigned char c)
{
  switch (c)
    {
    default: return c - '0';
    case 'a': case 'A': return 10;
    case 'b': case 'B': return 11;
    case 'c': case 'C': return 12;
    case 'd': case 'D': return 13;
    case 'e': case 'E': return 14;
    case 'f': case 'F': return 15;
    }
}

/* Print the words in LIST to standard output.  If the first word is
   `-n', then don't print a trailing newline.  We also support the
   echo syntax from Version 9 unix systems. */

int
main (int argc, char **argv)
{
  bool display_return = true;
  bool allow_options =
    (! getenv ("POSIXLY_CORRECT")
     || (! DEFAULT_ECHO_TO_XPG && 1 < argc && STREQ (argv[1], "-n")));

  /* System V machines already have a /bin/sh with a v9 behavior.
     Use the identical behavior for these machines so that the
     existing system shell scripts won't barf.  */
  bool do_v9 = DEFAULT_ECHO_TO_XPG;

  initialize_main (&argc, &argv);
  set_program_name (argv[0]);
  setlocale (LC_ALL, "");
  bindtextdomain (PACKAGE, LOCALEDIR);
  textdomain (PACKAGE);

  atexit (close_stdout);

  /* We directly parse options, rather than use parse_long_options, in
     order to avoid accepting abbreviations.  */
  if (allow_options && argc == 2)
    {
      if (STREQ (argv[1], "--help"))
        usage (EXIT_SUCCESS);

      if (STREQ (argv[1], "--version"))
        {
          version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS,
                       (char *) NULL);
          exit (EXIT_SUCCESS);
        }
    }

  --argc;
  ++argv;

  if (allow_options)
    while (argc > 0 && *argv[0] == '-')
      {
        char const *temp = argv[0] + 1;
        size_t i;

        /* If it appears that we are handling options, then make sure that
           all of the options specified are actually valid.  Otherwise, the
           string should just be echoed.  */

        for (i = 0; temp[i]; i++)
          switch (temp[i])
            {
            case 'e': case 'E': case 'n':
              break;
            default:
              goto just_echo;
            }

        if (i == 0)
          goto just_echo;

        /* All of the options in TEMP are valid options to ECHO.
           Handle them. */
        while (*temp)
          switch (*temp++)
            {
            case 'e':
              do_v9 = true;
              break;

            case 'E':
              do_v9 = false;
              break;

            case 'n':
              display_return = false;
              break;
            }

        argc--;
        argv++;
      }

just_echo:

  if (do_v9)
    {
      while (argc > 0)
        {
          char const *s = argv[0];
          unsigned char c;

          while ((c = *s++))
            {
              if (c == '\\' && *s)
                {
                  switch (c = *s++)
                    {
                    case 'a': c = '\a'; break;
                    case 'b': c = '\b'; break;
                    case 'c': exit (EXIT_SUCCESS);
                    case 'e': c = '\x1B'; break;
                    case 'f': c = '\f'; break;
                    case 'n': c = '\n'; break;
                    case 'r': c = '\r'; break;
                    case 't': c = '\t'; break;
                    case 'v': c = '\v'; break;
                    case 'x':
                      {
                        unsigned char ch = *s;
                        if (! isxdigit (ch))
                          goto not_an_escape;
                        s++;
                        c = hextobin (ch);
                        ch = *s;
                        if (isxdigit (ch))
                          {
                            s++;
                            c = c * 16 + hextobin (ch);
                          }
                      }
                      break;
                    case '0':
                      c = 0;
                      if (! ('0' <= *s && *s <= '7'))
                        break;
                      c = *s++;
                      /* Fall through.  */
                    case '1': case '2': case '3':
                    case '4': case '5': case '6': case '7':
                      c -= '0';
                      if ('0' <= *s && *s <= '7')
                        c = c * 8 + (*s++ - '0');
                      if ('0' <= *s && *s <= '7')
                        c = c * 8 + (*s++ - '0');
                      break;
                    case '\\': break;

                    not_an_escape:
                    default:  putchar ('\\'); break;
                    }
                }
              putchar (c);
            }
          argc--;
          argv++;
          if (argc > 0)
            putchar (' ');
        }
    }
  else
    {
      while (argc > 0)
        {
          fputs (argv[0], stdout);
          argc--;
          argv++;
          if (argc > 0)
            putchar (' ');
        }
    }

  if (display_return)
    putchar ('\n');
  exit (EXIT_SUCCESS);
}

Name: Anonymous 2011-01-06 13:51

>>7
Go away with your GNU/Rubbish. Nobody likes you. Nobody will ever love you. You will die alone.

Name: Anonymous 2011-01-06 14:19

Congratulations on not understanding C, OP.

Name: Anonymous 2011-01-06 14:49

/* echo.c, derived from code echo.c in Bash.
   Copyright (C) 1987, 1989, 1991-1997, 1999-2005, 2007-2010 Free Software
   Foundation, Inc.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <" target="_blank">http://www.gnu.org/licenses/>;;.  */

Name: Rimmis 2011-01-06 16:08

>>8
Enemy of Freedom!

Name: Anonymous 2011-01-06 16:50

>>1
You should haved posted this on openbsd-misc. They would have done a better job of notching you down than this thread has.

Name: Anonymous 2011-01-06 17:23

Anonix echo:
/* @echo.c */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char **argv) {
 int i=1, no_nl=0, ret=0;

 if(argc>1 && !strcmp(argv[1],"-n")) {
  no_nl=1;
  i++;
 }
 while(i<argc) {
  ret|=(fputs(argv[i++], stdout)==EOF);
  if(i!=argc)
   ret|=(fputc(' ',stdout)==EOF);
 }
 if(!no_nl)
  ret|=(fputc('\n',stdout)==EOF);
 return ret;
}

Name: Anonymous 2011-01-06 18:38

>>13
I OMG OPTIMISED it a little. Am I an ANONIX developer already?
/* @echo.c */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char **argv) {
 int no_nl=0, ret=0;

 if(argc>1 && !strcmp(*++argv,"-n")) {
  no_nl=1;
  ++argv;
 }
 for(;*argv;*argv && (ret|=(fputc(' ',stdout))==EOF))
  ret|=(fputs(*argv++,stdout)==EOF);
 if(!no_nl)
  ret|=(fputc('\n',stdout)==EOF);
 return ret;
}

Name: Anonymous 2011-01-06 18:40

>>14
/* @echo.c */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char **argv) {
 int no_nl=0, ret=0;

 if(argc>1 && !strcmp(*++argv,"-n"))
  no_nl=1;

 for(++argv;*argv;*argv && (ret|=(fputc(' ',stdout))==EOF))
  ret|=(fputs(*argv++,stdout)==EOF);
 if(!no_nl)
  ret|=(fputc('\n',stdout)==EOF);
 return ret;
}

Name: Anonymous 2011-01-06 18:53

>>11
s/Enemy of Freedom/Enemy of GNU/

GNU didn't fucking invent Freedom.

Name: Anonymous 2011-01-06 19:40

>>16
Don't be silly, GNU didn't invent freedom. We are merely the prophets of freedom.
[tt]                                .   .
                               /'   `\
                              //     \\
                             ( ~\\~//~ )
                              ~| @"@ |~
                               '  :  ' .
                      / \~\~\~  \ : /' ~/~/~/\
                     / \        (._.)        / \
                     /   \___-/   ;   \-___/   \
                   /      |               |      \
                  /      /    ---___---    \      \
                  (   ./      \ / __  /      \.   ?
                 /   /  (  --  .|   |.  --  ?  \   \
                 :   ,.  \      \---/      /   / ' :
                | \_/  '   (     \./     ?    \___/,
                  \    `.__ |           | __.'    /|
                |   \      : ---_____--- :      /  |
                      `-___:`---_|_|_---':___-'
                |           /\         /\          |
                           /  \       /  \
                |         /     \   /     \        |
                          |       v       |
                |         |       |       |        |
                |         |       |       |        |
                          \      / \      /        |
                |          |    |   |    |
                            \  /     \  /          |
               |            [  ]     [  ]
                 /  /      \-..-/   \-..-/     \   \
              /            |    |   |    |
                /  /    /   |  |     |  |   \     \    \
            /  ~ ~  ~  ~    :  :     :  :   ~   ~ ~ ~   \
           ~ ~              :__:     :__:              ~ ~
                           (____)   (____)

           _____                          _______   ____  __
          / ___/__  ______  ___  _____   / ____/ | / / / / /
          \__ \/ / / / __ \/ _ \/ ___/  / / __/  |/ / / / /
         ___/ / /_/ / /_/ /  __/ /     / /_/ / /|  / /_/ /
        /____/\__,_/ .___/\___/_/      \____/_/ |_/\____/
                   /_/

 ___       __             _                __   _   _           ___ ___  _
|   \ ___ / _|___ _ _  __| |___ _ _   ___ / _| | |_| |_  ___   / __| _ \| |
| |) / -_)  _/ -_) ' \/ _` / -_) '_| / _ \  _| |  _| ' \/ -_) | (_ |  _/| |__
|___/\___|_| \___|_||_\__,_\___|_|   \___/_|    \__|_||_\___|  \___|_|  |____|[/tt]

Name: Anonymous 2011-01-06 19:40

                                .   .
                               /'   `\
                              //     \\
                             ( ~\\~//~ )
                              ~| @"@ |~
                               '  :  ' .
                      / \~\~\~  \ : /' ~/~/~/\
                     / \        (._.)        / \
                     /   \___-/   ;   \-___/   \
                   /      |               |      \
                  /      /    ---___---    \      \
                  (   ./      \ / __  /      \.   ?
                 /   /  (  --  .|   |.  --  ?  \   \
                 :   ,.  \      \---/      /   / ' :
                | \_/  '   (     \./     ?    \___/,
                  \    `.__ |           | __.'    /|
                |   \      : ---_____--- :      /  |
                      `-___:`---_|_|_---':___-'
                |           /\         /\          |
                           /  \       /  \
                |         /     \   /     \        |
                          |       v       |
                |         |       |       |        |
                |         |       |       |        |
                          \      / \      /        |
                |          |    |   |    |
                            \  /     \  /          |
               |            [  ]     [  ]
                 /  /      \-..-/   \-..-/     \   \
              /            |    |   |    |
                /  /    /   |  |     |  |   \     \    \
            /  ~ ~  ~  ~    :  :     :  :   ~   ~ ~ ~   \
           ~ ~              :__:     :__:              ~ ~
                           (____)   (____)

           _____                          _______   ____  __
          / ___/__  ______  ___  _____   / ____/ | / / / / /
          \__ \/ / / / __ \/ _ \/ ___/  / / __/  |/ / / / /
         ___/ / /_/ / /_/ /  __/ /     / /_/ / /|  / /_/ /
        /____/\__,_/ .___/\___/_/      \____/_/ |_/\____/
                   /_/

 ___       __             _                __   _   _           ___ ___  _
|   \ ___ / _|___ _ _  __| |___ _ _   ___ / _| | |_| |_  ___   / __| _ \| |
| |) / -_)  _/ -_) ' \/ _` / -_) '_| / _ \  _| |  _| ' \/ -_) | (_ |  _/| |__
|___/\___|_| \___|_||_\__,_\___|_|   \___/_|    \__|_||_\___|  \___|_|  |____|

Super Failure Defender of the Fail

Name: Anonymous 2011-01-06 21:13

>>17,18

Stop that niggerdickery at once.

Name: Anonymous 2011-01-06 22:54

2 spaces for indentation?
GNU = FrozenVoid

Name: Anonymous 2011-01-07 2:46

>>20
No, it's:

if(...)
  { /* two spaces */
     ...; /* four spaces (and Perl's Yada Yada Operator) */
  } /* two spaces */
else
     ...; /* four spaces (and, again, Perl's Yada Yada Operator, so
VALID PERL CODE#) */

Name: Anonymous 2011-01-07 2:59

>>21
Perl doesn't have a Yada Yada Operator.  Perhaps you're thinking of Perl's flip-floperator?

Name: Anonymous 2011-01-07 3:06

>>22
PERL HAS EVERY OPERATOR IT WANTS, OK?
http://search.cpan.org/~jesse/perl-5.12.0/pod/perlop.pod#Yada_Yada_Operator___

HEIL TO PERL, OPERATOR OVERLORD!

Name: Anonymous 2011-01-07 4:35

At least Haskell calls it undefined, not some shamanistic guttural sounds.

Name: Anonymous 2011-01-07 5:53

>>2

There is no boolean type in C.
There is an explicit boolean type in C99. Sure, it's just a wrapper around integer but...

All integer and pointer types can be evaluated in boolean operations.
Pointer types should not be evaluated as boolean.

Brad Thomas,
CERT Security Manager

Name: Anonymous 2011-01-07 6:04

>>25
should != could

Name: Anonymous 2011-01-07 6:29

>>7 just makes me dribble with some kind of... emotion

Name: Anonymous 2011-01-07 6:33

>>25
>>26

According to the standard: pointer types can not be evaluated as boolean.

Name: Anonymous 2011-01-07 6:58


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

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

    /* 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)
            (void)putchar(' ');
    }
    if (!nflag)
        (void)putchar('\n');

    return EXIT_SUCCESS;
}


That's all the changes it needs.

Name: Anonymous 2011-01-07 7:03

>>29
I find that Anoncoreutils' echo.c (>>13) is better.

Name: Anonymous 2011-01-07 7:14

Fuck you 4 space tab faggotsp

[source]#include <iostream>

int main(std::size_t count, char *arguments[])
{
  while(count-->0) std::cout << arguments[count-1];
  return std::EXIT_SUCCESS;
}[/source]

Name: Anonymous 2011-01-07 7:27

>>31
Fuck you brackets on their line faggotsp

#include<stdio.h>
#include<stdlib.h>
#define _(x,y) ((*(x))&&(y))
main(int c,char**a)
{int n=(*++a&&(_(*a,(*a[0]=='-')&&(*a[1]=='n'))));
 for(;*a;_(*a,putchar(' ')))fputs(*a,stdout);_(n,putchar('
'));
 return 0;}

Name: Anonymous 2011-01-07 7:29

>>32
Fuck, my BBCode parsed \n as newline.
#include<stdio.h>
#include<stdlib.h>
#define _(x,y) ((*(x))&&(y))
main(int c,char**a)
{int n=(*++a&&(_(*a,(*a[0]=='-')&&(*a[1]=='n'))));
 for(;*a;_(*a,putchar(' ')))fputs(*a,stdout);_(n,putchar('\n'));
 return 0;}

Name: Anonymous 2011-01-07 8:10

>>33
s/((*(x))/((x)/
FTFY

Name: Anonymous 2011-01-07 8:54

>>33
That would make no difference anyway.

Name: Anonymous 2011-01-07 10:14

>>13

Please submit this code to OpenBSD

Name: Anonymous 2011-01-07 10:27

#define public_cALLOc    calloc
#define public_fREe      free
#define public_cFREe     cfree
#define public_mALLOc    malloc
#define public_mEMALIGn  memalign
#define public_rEALLOc   realloc
#define public_vALLOc    valloc
#define public_pVALLOc   pvalloc
#define public_mALLINFo  mallinfo
#define public_mALLOPt   mallopt
#define public_mTRIm     malloc_trim
#define public_mSTATs    malloc_stats
#define public_mUSABLe   malloc_usable_size
#define public_iCALLOc   independent_calloc
#define public_iCOMALLOc independent_comalloc
#define public_gET_STATe malloc_get_state
#define public_sET_STATe malloc_set_state


gODFUQINDAMn

Name: Anonymous 2011-01-07 10:33

>>36
You submit that code to OpenBSD, I will not reveal myself!

Name: Anonymous 2011-01-07 10:55

>>37
ALLO?
STATU
SABLE

Name: Anonymous 2011-01-07 11:56

>>38
Fuck you man, get some balls.
At least I'm brave enough to admin... that I'm afraid of Theo de Raadt.

Name: Anonymous 2011-01-07 12:34

ADMITISTRATION

Name: Anonymous 2011-01-08 11:17

Received: (SNIP 12196 invoked from network); SNIP
X-AntiVirus: SNIP
X-Scan-Status: AV clean (0.01283 seconds);
    AS clean (0.01761 seconds);
Received: from unknown (HELO cvs.openbsd.org) ([199.185.137.3])
          (envelope-sender <deraadt@cvs.openbsd.org>)
          by SNIP (SNIP) with AES256-SHA encrypted SMTP
          for <SNIP>; SNIP
Received: from cvs.openbsd.org (localhost [127.0.0.1])
    by cvs.openbsd.org (8.14.3/8.12.1) with ESMTP id p06G2B0N017820
    for SNIP; Thu, SNIP
Message-Id: <SNIP@cvs.openbsd.org>
To: SNIP
Subject: Re: Question about GIF files on openbsd.org
In-reply-to: Your message of SNIP
             SNIP
Date: SNIP
From: Theo de Raadt <deraadt@cvs.openbsd.org>

Is this because of legacy systems?

No.  It is because we are programmers and it doesn't matter.

Name: Anonymous 2011-01-08 14:15

>>21
Not valid. if is not a sub.
if()
  ^ expecting space

Name: Anonymous 2011-01-08 14:18

check 'em

Name: Anonymous 2011-01-08 15:05

>>44
Check the URL, son.  You're not in /b/, and you should hold yourself to a higher standard.

Name: Anonymous 2011-01-08 15:09

>>45
HIGHER STANDARD MY ANUS

Name: Anonymous 2011-01-08 15:19

>>46
Immaturity is not welcome here.  Please find another board if you can't control yourself.

Name: Anonymous 2011-01-08 15:26

>>47
SELF-CONTROL MY ANUS

Name: Anonymous 2011-01-08 15:27

>>48
SELF-CONTROL MY ANUS MY ANUS

Name: Anonymous 2011-01-08 15:30

>>47
CONTROL MY ANUS

Name: Jeffrey Codan 2011-01-08 15:32

Tsk.

Name: Anonymous 2011-01-08 15:41

>>48-50
Shameful.

Name: @FULLFORCE 2011-01-08 19:21

>>52
SHAMEFUL MY ANUS

Name: Anonymous 2011-01-13 4:18

My other Theo de Raadt is a Theo de Rddat.

Name: Anonymous 2011-01-31 19:45

<-- check em dubz

Name: Anonymous 2011-03-11 10:43

>>33
??=include<stdio.h>
??=include<stdlib.h>
??=define _(x,y)??/
((x)&&(y))
main(int c,char**a)
??<int n=(*++a&&(_(*a,(0??(*a??)=='-')&&(1??(*a??)=='n'))));
 for(;*a;_(*a,putchar(' ')))fputs(*a,stdout);_(n,putchar('??/n'));
 return 0;??>

Name: Anonymous 2011-03-11 10:43

Forgot my bump.

Name: Anonymous 2011-03-11 11:09

>>56
cool trigraphs bro

Name: Anonymous 2011-03-11 11:23

The Reagents of the University of California
I keep reading it that way every time.

Name: Anonymous 2011-03-11 14:06

;;; ;;;
;;; @file echo.asm
;;; @brief display a line of text
;;;
;;; @assemble    nasm -f elf -Ox echo.asm
;;; @link    ld -s echo.o -o echo
;;; @clean    rm -f echo.o
;;;
;;; @author Gerald Jay Sussman (Massachvsetts Institvte of Technology)
;;;
;;; Copyright (C) 2011 Gerald Jay Sussman and the Massachvsetts
;;; Institvte of Technology. All rights reserved.
;;;
;;; The new BSD License is applied to this software, see LICENSE.txt
;;; ;;;

section    .bss
chrbuf:    resb    1

section    .text
    global    _start

_start:
    pop    ecx
    pop    eax
    dec    ecx
    test    ecx, ecx
    jz    .fin
.argvloop:
    pop    eax
    call    print_string

    mov    al, 0x20
    call    print_char

    loop    .argvloop
.fin:
    mov    al, 0x0A
    call    print_char

    mov    eax, 1
    mov    ebx, 0
    int    0x80

;;; Snip from the SUSSIX corelibs
print_string:
    pushad
    push    eax
    mov    edi, eax

    xor    ecx, ecx
    xor    al, al
    not    ecx
    cld
    repne    scasb
    not    ecx
    lea    edx, [ecx - 1]
    pop    ecx

    mov    eax, 4
    mov    ebx, 1
    int    0x80
    popad
    ret

print_char:
    pushad
    mov    [chrbuf], al

    mov    eax, 4
    mov    ebx, 1
    mov    ecx, chrbuf
    mov    edx, 1
    int    0x80

    popad
    ret

Name: Anonymous 2011-03-11 14:25

>>56
what is the purpose of ??

Name: Anonymous 2011-03-11 14:26

pushad
popad

ALPHA AS FUCK

Name: Anonymous 2011-03-11 14:30

>>62

The SUSSIX standard requires it.

Name: Anonymous 2011-03-11 15:25

>>60
More of this

Name: Anonymous 2011-03-11 17:26

>>60
GJS
The new BSD License

No MIT License?
IHBT

Name: Anonymous 2011-03-11 17:44

>>65

Me and the other SUSSIX developers (Me) have decided to adopt the SUSSIX License, which is just a BSD License which marks the Sussman and MIT as the copyright holders.

We (the SUSSIX dev team (Me)) felt that since the actual Sussman probably had no idea that we were infringing on his name it would be a good idea to use the new BSD License for the following clause;

      * Neither the name of the <organization> nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.


I'm sure he would appreciate that, especially since it is quite obvious to me and the rest of the SUSSIX dev team (Me) that we will soon see the widespread adoption of SUSSIX software and hardware (we sell rubber bands and t-shirts) on all platforms (this might seem counter-intuitive due to the use of Linux specific system calls) in the very near future.

We (the SUSSIX dev team (Me)) also feel that the BSD License has the same permissive nature of the MIT License so that it holds true to the SUSSIX/MIT philosophy.

Name: Anonymous 2011-03-11 17:48

>>60

A message from the SUSSIX dev team (Me):
This version of echo has a bug in it, it would output a space before the last newline if it outputted some other text, it also didn't support the popular -n option.


;;; ;;;
;;; @file echo.asm
;;; @brief display a line of text
;;;
;;; @assemble    nasm -f elf -Ox echo.asm
;;; @link    ld -s echo.o -o echo
;;; @clean    rm -f echo.o
;;;
;;; @author Gerald Jay Sussman (Massachvsetts Institvte of Technology)
;;;
;;; Copyright (C) 2011 Gerald Jay Sussman and the Massachvsetts
;;; Institvte of Technology. All rights reserved.
;;;
;;; The new BSD License is applied to this software, see LICENSE.txt
;;; ;;;

section    .data
optn:    db    "-n", 0

section    .bss
chrbuf:    resb    1

section    .text
    global    _start

_start:
    mov    edx, 0
    pop    ebx
    times 2 pop eax
   
    dec    ebx
    test    ebx, ebx
    jz    .LF

    mov    esi, optn
    mov    edi, eax
    mov    ecx, 3
    cld
    repe    cmpsb

    mov    ecx, ebx
    cmove    edx, ebx
    je    .optn

    push    eax

    jmp    .argvloop

.optn:
    dec    ecx
    test    ecx, ecx
    jz    .fin

    jmp    .argvloop

.SPACE:
    mov    al, 0x20
    call    print_char
.argvloop:
    pop    eax
    call    print_string

    loop    .SPACE

    test    edx, edx
    jnz    .fin

.LF:
    mov    al, 0x0A
    call    print_char
.fin:
    mov    eax, 1
    mov    ebx, 0
    int    0x80

;;; Snip from the SUSSIX corelibs
print_string:
    pushad
    push    eax
    mov    edi, eax

    xor    ecx, ecx
    xor    al, al
    not    ecx
    cld
    repne    scasb
    not    ecx
    lea    edx, [ecx - 1]
    pop    ecx

    mov    eax, 4
    mov    ebx, 1
    int    0x80
    popad
    ret

print_char:
    pushad
    mov    [chrbuf], al

    mov    eax, 4
    mov    ebx, 1
    mov    ecx, chrbuf
    mov    edx, 1
    int    0x80

    popad
    ret

Name: Anonymous 2011-03-11 18:09

>>62,63

By the way If you are interested in the SUSSIX standard you should know that it requires any sub-routine (non-_start) to preserve the values of every register upon returning, therefore no sub-routine conforming to the SUSSIX standard has any return values ever.

On a side not it is worth mentioning that if a routine does not conform to the standard the author of the routine is to be taken out behind the chemical shed and shot. Luckily we have not had any incidents yet except for the loss of my cat Mr. Bojangles which accidentally pressed some keys with its paws while attempting to cuddle with me and therefore produced a non standard conforming sub-routine.

If you are interested in joining the SUSSIX dev team just say so in this thread.

Name: Anonymous 2011-03-11 18:29

>>68
SUSSIX sucks because it's still tied to the past with 32-bit x86. Should at least be writing for 64-bit x86-64.

Name: Anonymous 2011-03-11 18:42

>>24
>I've never watched Seinfeld
heathen

Name: Anonymous 2011-03-11 21:19

>>69
It's much better than ANONIX, though.

Name: Anonymous 2011-03-12 6:07

>>69

Do not worry, even though it appears that it is 32 bit code (due to the use of 32 bit registers) SUSSIX will actually become 128 bit by the end of this year. We plan on porting all our code to SSE2 which operates on the 128 bit XMM registers. Currently SUSSIX is variable bit length, everything from 32-8 bit. We are also working on a sed line which will convert all our code from 32 bit to 64 bit, but the 128 bit comes first.

It is obvious to me that SUSSIX will set the standard for 128 bit applications and operating systems so that in the future when we run out of address space in 64 bit systems SUSSIX will take over the world.

Name: Anonymous 2011-03-12 7:11

Where can I get these rubber bands?

Name: Anonymous 2011-03-12 7:43

>>73

SUSSIX hardware is only available in St. Pierre and Miquelon, East Timor and the Vatican City State. But do not worry, we are working on it.

Name: Anonymous 2011-06-20 12:17

>>70
Seinfeld was not entertaining.

Name: Anonymous 2011-06-20 12:40

sussix, just like lisp, is for flaming fags

Name: Anonymous 2011-06-20 12:49

sum prlp wen facd w/ a problem dey think 'i no use regaxum ' now their 2 probloms

Name: Anonymous 2011-06-20 13:20

>>7
That's truly disgusting code.

Name: Anonymous 2011-06-20 18:48

>>74
I tried to buy SUSSIX at the Vatican but the pope wouldn't let me. He said the Suss was a dirty jew, which is obviously false.

Name: Anonymous 2011-06-20 19:29

>>7
this looks like some shit IDA would poop out

Name: Anonymous 2011-06-20 19:47

SUSSIX
ANONIX

Why is everyone constantly re-implementing shitty old UNIX?  Are people too stupid to come up with something original?

Name: Anonymous 2011-06-20 19:53

>>81
Why fix something that not only isn't broken, but is actually superior to everything else out on the market?

Name: Anonymous 2011-06-20 19:56

>>82
Why fix something that not only isn't broken

So then why are you re-implementing it?

Name: Anonymous 2011-06-20 20:04

>>83
So that it respects my anonymity and the anonymity of the developers. The design itself is sound.

Name: Anonymous 2011-06-20 20:14

>>84
The design itself is soundwhat I first learned and I am unable to understand anything beyond it.

Name: Anonymous 2011-06-20 20:17

>>85
Nope, I first learned computing and programming on DOS and then Windows. Unix/Posix is far superior.

Name: Anonymous 2011-06-20 20:21

>>86
No, Unix/Posix is the first OS design you learned at college/university.  People don't learn much about OS design when they are first figuring out how to use and program a computer.  DOS and Windows was just a black box to you.

Name: Anonymous 2011-06-20 21:29

>>82
UNIX
Why fix something that not only isn't broken
that not only isn't broken
isn't broken

Name: Anonymous 2011-06-20 21:29

>>82
[br] and [o] don't compose well.

Name: VIPPER 2011-06-21 4:15

UNIX is total shit, outdated and designed for computers from the 70s.
The lack of originality is everything wrong in the software world.

Name: Anonymous 2011-08-06 15:20

>>79
The pope is not a certified SUSSIX™ salesman.

Don't change these.
Name: Email:
Entire Thread Thread List