diff options
author | Christopher Faylor <me@cgf.cx> | 2004-02-21 04:51:15 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-02-21 04:51:15 +0000 |
commit | 7c03f79971ed1e8ab3ad8818747444b60ed8cd38 (patch) | |
tree | 01a3302b4b3af940a5739a40c488f57ed4613e4a /winsup/utils/cygpath.cc | |
parent | 3a0f12b5885fa877c3365ef0ff114346f21ce92c (diff) | |
download | newlib-7c03f79971ed1e8ab3ad8818747444b60ed8cd38.zip newlib-7c03f79971ed1e8ab3ad8818747444b60ed8cd38.tar.gz newlib-7c03f79971ed1e8ab3ad8818747444b60ed8cd38.tar.bz2 |
* Makefile.in (build_dumper): Detect missing iconv library.
* cygpath.cc (dowin): Report on filename conversion errors.
(doit): Ditto.
* strace.cc (main): Use symbolic constant for _STRACE_ALL when setting mask.
Diffstat (limited to 'winsup/utils/cygpath.cc')
-rw-r--r-- | winsup/utils/cygpath.cc | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc index 070b19b..cb64916 100644 --- a/winsup/utils/cygpath.cc +++ b/winsup/utils/cygpath.cc @@ -1,5 +1,5 @@ /* cygpath.cc -- convert pathnames between Windows and Unix format - Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. This file is part of Cygwin. @@ -20,6 +20,7 @@ details. */ #include <sys/fcntl.h> #include <sys/cygwin.h> #include <ctype.h> +#include <errno.h> static const char version[] = "$Revision$"; @@ -391,8 +392,11 @@ dowin (char option) if (!windows_flag) { - cygwin_conv_to_posix_path (buf, buf2); - buf = buf2; + if (cygwin_conv_to_posix_path (buf, buf2)) + fprintf (stderr, "%s: error converting \"%s\" - %s\n", + prog_name, buf, strerror (errno)); + else + buf = buf2; } else { @@ -410,7 +414,7 @@ doit (char *filename) { char *buf; DWORD len; - int retval; + int err; int (*conv_func) (const char *, char *); if (!path_flag) @@ -441,10 +445,12 @@ doit (char *filename) if (path_flag) { if (unix_flag) - cygwin_win32_to_posix_path_list (filename, buf); + err = cygwin_win32_to_posix_path_list (filename, buf); else { - cygwin_posix_to_win32_path_list (filename, buf); + err = cygwin_posix_to_win32_path_list (filename, buf); + if (err) + /* oops */; if (shortname_flag) buf = get_short_paths (buf); if (longname_flag) @@ -452,6 +458,12 @@ doit (char *filename) if (mixed_flag) buf = get_mixed_name (buf); } + if (err) + { + fprintf (stderr, "%s: error converting \"%s\" - %s\n", + prog_name, filename, strerror (errno)); + exit (1); + } } else { @@ -461,13 +473,13 @@ doit (char *filename) else conv_func = (absolute_flag ? cygwin_conv_to_full_win32_path : cygwin_conv_to_win32_path); - retval = conv_func (filename, buf); + err = conv_func (filename, buf); if (mixed_flag) buf = get_mixed_name (buf); - if (retval < 0) + if (err) { - fprintf (stderr, "%s: error converting \"%s\"\n", - prog_name, filename); + fprintf (stderr, "%s: error converting \"%s\" - %s\n", + prog_name, filename, strerror (errno)); exit (1); } if (!unix_flag) |