summaryrefslogtreecommitdiffstats
path: root/winsup/utils/cygpath.cc
Commit message (Collapse)AuthorAgeFilesLines
* * cygpath.cc (do_pathconv): Fix erroneously printing native NT pathCorinna Vinschen2010-02-221-1/+3
| | | | prefix introduced by previous patch.
* * cygpath.cc (do_pathconv): Fix potential crash.Corinna Vinschen2010-02-131-6/+4
|
* * cygpath.cc (get_mixed_name): Drop function. Replace with call toCorinna Vinschen2010-01-161-35/+8
| | | | | | convert_slashes throughout. (do_sysfolders): Free allocated buffer. (do_pathconv): Fix freeing last buffer.
* * cygpath.cc: Throughout, free obsolete path buffers.Corinna Vinschen2010-01-071-12/+48
|
* * cygpath.cc (main): Remove enforcing "en_US.UTF-8" locale.Corinna Vinschen2010-01-071-26/+20
| | | | | | | Revert usage of argz functions when reading input from file and simplify option usage. Allow only one option argument and use the rest as filename argument to allow spaces in filenames. Restrict processing special folder type options to one line.
* * cygpath.cc (get_special_folder): Fetch path as WCHAR and convertCorinna Vinschen2009-10-151-25/+36
| | | | | | | using my_wcstombs. (get_user_folder): Remove. (do_sysfolders): Use get_special_folder instead of get_user_folder. Fetch system paths as WCHAR and convert using my_wcstombs.
* * cygpath.cc (codepage): New variable.Corinna Vinschen2009-05-171-9/+45
| | | | | | | | | (long_options): Add --codepage option. (options): Add -C option. (usage): Add -C/--codepage description. (my_wcstombs): New function. Use througout instead of wcstombs. (do_options): Handle -C/--codepage option. * utils.sgml (cygpath): Add description for new -C/--codepage option.
* * cygpath.cc (main): Only setlocale for LC_CTYPE category. FallbackCorinna Vinschen2009-05-151-1/+4
| | | | | | | | to UTF-8 if locale is "C". * ldd.cc (main): Ditto. * mkgroup.c (main): Ditto. * mkpasswd.c (main): Ditto. * passwd.c (main): Ditto.
* * cygpath.cc (do_pathconv): Only skip \\?\ prefix if it's reallyCorinna Vinschen2009-04-151-9/+12
| | | | | given. Do backslash to slash conversion for mixed paths after handling \\?\ prefix.
* * wide_path.h (class wide_path): New class to convert Windows pathCorinna Vinschen2009-03-141-48/+90
| | | | | | | | | | | | | | | | | | | | to WCHAR win32 path, including long path conversion if necessary. * cygcheck.cc: Use class wide_path throughout to call Win32 functions taking potentially long filenames. (display_error): Use snprintf rather than sprintf. (display_error_fmt): Ditto. (dump_sysinfo): Use FindFirstFileW/FindNextFileW. * cygpath.cc: Use class wide_path throughout to call Win32 functions taking potentially long filenames. (get_device_name): Raise buffer size to take long pathnames. (get_short_paths): Convert to using GetShortPathNameW. (get_short_name): Ditto. (get_long_path_name_w32impl): Convert to equivalent of GetLongPathNameW. (get_long_name): Convert to using GetLongPathNameW. (do_sysfolders): Raise buffer size for POSIX pathname to PATH_MAX. (do_pathconv): In case of POSIX->Win32 conversion, convert to wchar_t Win32 path name and drop long pathname prefix if possible. (main): Call setlocale to accommodate wide char/multibyte conversions.
* * Makefile.in (cygcheck.exe): Link against ntdll.Corinna Vinschen2008-07-221-4/+3
| | | | | | | | | | | | | | | | | | | | * bloda.cc: Use statically linked functions throughout. * cygpath.cc: Drop 9x considerations. * mkgroup.c: Revamp. Redefine -l and -d options to take optional machine and domain parameters. Redefine -c to work always, using token information. Add -L, -D, -C to create unique groupnames in domain\group syntax. Add -S option to define domain\group separator char. Ignore -u and -s options. * mkpasswd.c: Revamp. Redefine -l and -d options to take optional machine and domain parameters. Redefine -c to work always, using token information. Add -L, -D, -C to create unique usernames in domain\user syntax. Add -S option to define domain\user separator char. Ignore -g and -s options. Prefer to take homedir from $HOME over $HOMEDRIVE/$HOMEPATH. * path.cc (oopts): Add "acl", "noacl", "posix=0" and "posix=1" options. (getmntent): Accomodate throughout. * ps.cc: Fix copyright dates. * utils.sgml: Fix text for mkgroup and mkpasswd.
* * cygpath.cc (do_sysfolders): Use cygwin_conv_path.Corinna Vinschen2008-03-121-17/+10
| | | | | | | | | | | | (do_pathconv): Use cygwin_conv_path and cygwin_conv_path_list. * dumper.cc (main): Use cygwin_conv_path. Allocate target path dynamically. * mkpasswd.c (current_user): Use cygwin_conv_path. (enum_users): Ditto. * ps.cc (NT_MAX_PATH): Define. (main): Use cygwin_conv_path. * regtool.cc (find_key): Ditto. Allocate target path dynamically. (cmd_save): Ditto.
* * cygpath.cc (do_options): Allow outputflag combined with otherCorinna Vinschen2007-05-291-9/+7
| | | | | | | basic flags. Only check options_from_file_flag if reading options from command line. (main): Check for NULL argz vector. Don't free argz vector prematurely. Don't force flag combination in !options_from_file_flag case.
* * cygpath.cc: Include argz.h.Corinna Vinschen2007-05-231-127/+115
| | | | | | | | | | | | | | (options_from_file_flag): Move from main to global static variable. (mode_flag): Ditto. (do_sysfolders): Rename from dowin and accommodate throughout. Don't exit from here. (do_pathconv): Rename from doit and accommodate throughout. (print_version): Change copyright. (do_options): New function, centralizing option processing. Rework checking options for correctness. (action): New function, centralizing calling worker functions. (main): Simplify. Move option processing to do_options. Move calling worker functions to action. Rework getting arguments from files.
* * utils/cygpath.cc (get_long_path_name_w32impl): Close handles returned byChristopher Faylor2007-03-311-4/+10
| | | | FindFirstFile.
* * cygpath.cc (usage): Add -O and -F, remove tabs.Corinna Vinschen2007-01-091-37/+78
| | | | | | | | (get_special_folder): New function. (get_user_folder): New function. (dowin): Add -O and -F, better -D, -P error handling. (main): Add -O and -F. * utils.sgml (cygpath): Document -O and -F.
* * Makefile.in (cygpath.exe): Add rule to link cygpath against ntdll.dll.Corinna Vinschen2006-08-021-0/+160
| | | | | | | | | * cygpath.cc: Include DDK headers. (RtlAllocateUnicodeString): New static inline function. (get_device_name): New static function to evaluate DOS path from native NT path. (get_device_paths): New function to do the same for path lists. (doit): Call get_device_paths/get_device_name where appropriate.
* * cygpath.cc (get_long_name): Fallback to get_long_path_name_w32impl.Corinna Vinschen2006-07-311-4/+11
|
* * cygpath.c (get_long_name): Cover the case that GetLongPathNameCorinna Vinschen2006-07-271-4/+10
| | | | | doesn't return valid information for non-existant files. Just return incoming filename in that case.
* * cygpath.cc (get_long_name): Load GetLongPathNameA instead of incorrectCorinna Vinschen2006-02-171-3/+3
| | | | | | GetLongPathName. (doit): Create mixed filename after converting to short or long pathname respectively.
* * cygpath.cc (dowin): Remove stray debugging printf statement.Dave Korn2006-01-181-1/+0
|
* * Makefile.in: Link cygcheck with libwininet.a.Christopher Faylor2005-11-221-0/+1
| | | | | | | | | | | | | | * cygcheck.cc: Add includes. (grep_packages): New global variable. (display_internet_error): New function. (safe_chars): New global variable. (base_url): Ditto. (package_grep): New function. (usage): Reword --help output for clarity. Document new argument. (longopts): Add 'package-query' option. (opts): Add 'p' option, reorder to be consistent with 'longopts'. (main): Accommodate new option. * utils.sgml (cygcheck): Update --help output. Document new -p option.
* * cygcheck.cc (cygwin_internal): Define as a "C" function.Christopher Faylor2005-05-171-2/+2
| | | | | * strace.cc (cygwin_internal): Ditto. * cygpath.cc (print_version): Update copyright.
* * cygpath.cc (usage): Pass in one more copy of program_name to printf to avoidChristopher Faylor2005-03-061-1/+1
| | | | a SEGV.
* * cygpath.cc (usage): Clarify help output to indicate acceptanceJoshua Daniel Franklin2005-02-241-6/+7
| | | | of multiple file names as arguments.
* * cygpath.cc (usage): Don't issue helpful message if -i is used.Christopher Faylor2004-03-151-4/+6
| | | | (from Igor Pechtchanski)
* * cygpath.cc (long_options): Add "mode" option.Christopher Faylor2004-02-251-6/+32
| | | | | | | (options): Ditto. (usage): Report on new option. (report_mode): New function. (main): Implement -M option.
* * Makefile.in (build_dumper): Detect missing iconv library.Christopher Faylor2004-02-211-10/+22
| | | | | | * cygpath.cc (dowin): Report on filename conversion errors. (doit): Ditto. * strace.cc (main): Use symbolic constant for _STRACE_ALL when setting mask.
* * cygpath.cc (dowin): Revert accidental checkin from November.Corinna Vinschen2004-01-221-8/+19
|
* * cygpath.cc (main): Allow multiple pathnames on command line.Corinna Vinschen2003-11-071-22/+13
|
* revert accidental checkinChristopher Faylor2003-10-171-8/+19
|
* * cygcheck.cc (pretty_id): Don't exec if `id' program is not found.Christopher Faylor2003-10-171-19/+8
|
* * Makefile.in (cygcheck.o): Use MINGW_CXX for compilation.Christopher Faylor2003-09-111-1/+1
| | | | | | * cygcheck.cc: Just include <getopt.h> rather than cygwin version. (pretty_id): Avoid compiler warnings. * cygpath.cc (usage): Ditto.
* Throughout, always return error when GetShortPathName returns 0.Christopher Faylor2003-06-121-3/+3
|
* * cygcheck.cc (usage) Add description output.Joshua Daniel Franklin2003-04-261-0/+2
|
* * cygpath.cc (doit): Allocate more space for non-path filename.Christopher Faylor2003-02-121-5/+5
|
* * cygpath.cc (get_long_path_name_w32impl): Define similarly to GetLongPathName.Christopher Faylor2002-10-311-132/+96
| | | | | | | (get_long_name): Correctly prototype GetLongPathName. (get_long_paths): Implement using get_long_name to cut down on code duplication. (doit): Do various things to make path output work predictably.
* * cygpath.cc (close_arg): Remove unused static.Christopher Faylor2002-09-301-1/+0
| | | | | | | * mkgroup.c (enum_local_users): Avoid compiler warning. (enum_users): Ditto. * mkpasswd.c: Ditto throughout. * ssp.c: Ditto throughout.
* 2002-09-12 Igor Pechtchanski <pechtcha@cs.nyu.edu>Joshua Daniel Franklin2002-09-151-2/+5
| | | | | | * cygpath.cc (options) New global variable. (main) Make short options global for easier change. (print_version) Add a missing newline.
* output some newlines.Christopher Faylor2002-08-231-2/+2
|
* * mount.cc (main): Ensure that mount_already_exists() also gets default flagChristopher Faylor2002-07-011-52/+103
| | | | | | | | | that is passed to do_mount. * cygpath.cc (long_options): Add "dos" and "mixed", correct "close", "file" and "type" to use NULL flag. (usage): Clean up usage output (more), accomodate new options. (main): Add --dos and --mixed options; accomodate all output forms in --type. Make UNIXy output default.
* * cygpath.cc (usage): Clean up usage output.Christopher Faylor2002-06-191-45/+50
| | | | (dowin): Correct output of -t mixed for -ADHPSW options.
* * cygpath.cc: Add option to output windows paths in different formats: "dos"Christopher Faylor2002-06-071-5/+57
| | | | | | and "mixed". (main): Process options. (doit): Check new options flags.
* * cygpath.cc (usage): Change usage output slightly.Corinna Vinschen2002-05-221-101/+269
| | | | | | | | | | | | | | | | * cygpath.cc (main): Add option l to support conversion to Windows long file names. Refactured code for capital options. Support of options from file for capital options. (dowin): New function. Refactured from main. (doit): Call long path conversion. (get_long_name): New function. (get_long_paths): New function. (get_long_path_name_w32impl): New function. Reimplementation of Windows API function GetLongPathName (only 98/Me/2000/XP or higher). (get_short_name): Call GetShortPathName only once. (get_short_paths): Fix calculating buffer size. * utils.sgml: Update cygpath section for l option.
* * cygpath.cc (get_short_paths): Fix more error checking.Corinna Vinschen2002-05-151-51/+50
| | | | | | | | | (get_short_name): Ditto. * cygpath.cc (main): Add option H to show the Windows' profiles directory. Support short names for options DPSW. Clean up copied code lines. * utils.sgml: Update cygpath section for H option and s support.
* * cygpath.cc (get_short_name): Fix error checking.Corinna Vinschen2002-05-141-1/+1
|
* * cygpath.cc: Reformat.Christopher Faylor2002-03-071-144/+172
| | | | | | * cygpath.cc (print_version): New function. (main): Accommodate new version function. Initialize 'o' to prevent warning. * cygcheck.cc (main): Eliminate non-GNU formatting glitch.
* Change copyright format.Christopher Faylor2002-02-271-1/+1
|
* * cygpath.cc (main): Add options to show Desktop and StartCorinna Vinschen2002-01-171-26/+116
| | | | | | Menu's Programs directory for current user or all users. Move bulk of DPWS options outside the getopt case statement. * utils.sgml: Update cygpath section for ADPWS options.
* * cygpath.cc (doit): Empty file ignored using option -i.Corinna Vinschen2002-01-151-2/+7
|