home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / c / csh4.zip / PWD.C < prev    next >
C/C++ Source or Header  |  1985-09-03  |  268b  |  19 lines

  1. #define NULL (void *)0
  2. pwd(argc,argv)
  3. char *argv[];
  4. {
  5.     char *getcwd();
  6.     register char *dir;
  7.     if (!(dir = getcwd(NULL,256)))
  8.     {
  9.         perror("pwd");
  10.         return -1;
  11.     }
  12.     write(1,"\\",1);
  13.     write(1,dir,strlen(dir));
  14.     crlf();
  15.     if (dir)
  16.         free(dir);
  17.     return 0;
  18. }
  19.