view toys/posix/pwd.c @ 694:786841fdb1e0

Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style. The actual code should be the same afterward, this is just cosmetic refactoring.
author Rob Landley <>
date Tue, 13 Nov 2012 17:14:08 -0600
parents 6df4ccc0acbe
children adab8adf5f6d
line wrap: on
line source

/* pwd.c - Print working directory.
 * Copyright 2006 Rob Landley <>
 * See
 * TODO: add -L -P


config PWD
  bool "pwd"
  default y
    usage: pwd

    The print working directory command prints the current directory.

#include "toys.h"

void pwd_main(void)
  char *pwd = xgetcwd();

  xprintf("%s\n", pwd);
  if (CFG_TOYBOX_FREE) free(pwd);