From: <ea...@us...> - 2004-03-15 15:20:38
|
Update of /cvsroot/mingw/msys/packages/bash/2.04/builtins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21473/builtins Modified Files: cd.def Log Message: 2002.04.26 Earnie Boyd <ea...@us...> * builtins/cd.def: Add ``pwd -W'' option. Index: cd.def =================================================================== RCS file: /cvsroot/mingw/msys/packages/bash/2.04/builtins/cd.def,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cd.def 24 Apr 2002 14:37:26 -0000 1.3 --- cd.def 15 Mar 2004 15:11:31 -0000 1.4 *************** *** 288,295 **** $BUILTIN pwd $FUNCTION pwd_builtin ! $SHORT_DOC pwd [-PL] Print the current working directory. With the -P option, pwd prints the physical directory, without any symbolic links; the -L option ! makes pwd follow symbolic links. $END --- 288,296 ---- $BUILTIN pwd $FUNCTION pwd_builtin ! $SHORT_DOC pwd [-PLW] Print the current working directory. With the -P option, pwd prints the physical directory, without any symbolic links; the -L option ! makes pwd follow symbolic links; the -W option, pwd prints the Win32 ! value of the physical directory. $END *************** *** 303,312 **** WORD_LIST *list; { ! char *directory, *buffer; int opt; verbatim_pwd = no_symbolic_links; reset_internal_getopt (); ! while ((opt = internal_getopt (list, "LP")) != -1) { switch (opt) --- 304,313 ---- WORD_LIST *list; { ! char *directory, *buffer, *wbuffer; int opt; verbatim_pwd = no_symbolic_links; reset_internal_getopt (); ! while ((opt = internal_getopt (list, "LPW")) != -1) { switch (opt) *************** *** 318,321 **** --- 319,325 ---- verbatim_pwd = 0; break; + case 'W': + verbatim_pwd = 2; + break; default: builtin_usage (); *************** *** 325,342 **** list = loptend; ! if (verbatim_pwd) { ! buffer = xmalloc (PATH_MAX); ! directory = getcwd (buffer, PATH_MAX); ! if (directory == 0) { ! builtin_error ("%s: %s", bash_getcwd_errstr, strerror (errno)); ! free (buffer); } ! } ! else ! { ! directory = get_working_directory ("pwd"); } --- 329,366 ---- list = loptend; ! switch (verbatim_pwd) { ! case 1: ! { ! buffer = xmalloc (PATH_MAX); ! directory = getcwd (buffer, PATH_MAX); ! if (directory == 0) ! { ! builtin_error ("%s: %s", bash_getcwd_errstr, strerror (errno)); ! free (buffer); ! } ! } ! break; ! case 2: ! { ! buffer = xmalloc (PATH_MAX); ! wbuffer = xmalloc (PATH_MAX); ! directory = getcwd (buffer, PATH_MAX); ! cygwin_conv_to_win32_path (buffer, wbuffer); { ! char *c = wbuffer; ! while (c = strchr (c, '\\')) ! *c = '/'; } ! free (buffer); ! directory = wbuffer; ! } ! break; ! default: ! { ! directory = get_working_directory ("pwd"); ! } ! break; } |