Greetings, Corinna Vinschen! >> >> I would like to request a small functional change for cygpath. >> >> In the event of empty given path argument (i.e. `cygpath -ml ""') silently >> >> return an empty result without error message. >> >> This would greatly simplify wrapper scripts. >> >> > Why isn't redirecting the message to /dev/null not sufficient, something >> > like this (bash syntax)? >> >> Because it'll require creating a redirection? And this kind of redundant >> inserts blurring the code. >> Returning a non-zero exit code would suffice for debugging purposes. >> >> > cygpath -ml "" >/dev/null 2&>1 >> >> Err, not > /dev/null !!! :D
> dos_path=$( [ -n "${posix_path}" ] && cygpath -ml "${posix_path}" ) > ? I appreciate the effort, bit this even MORE complicating the possible use case. Look, I'm asking for simplification without loosing functionality. If I NEED to check the path for existence, I would write something to the extent of NATIVE=$(cygpath -ml "$2") if [ $? -gt 0 ]; then yell at user; fi anyway. But if I (and the program that I would feed it to) don't care (which is often the case), the message printed from cygpath doesn't add to functionality. P.S. I've tried to rebuild it myself, but hit a roadblock. While trying to rebuild only winsup/utils, this happens checking build system type... i686-pc-cygwin checking host system type... i686-pc-cygwin checking target system type... i686-pc-cygwin checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for a BSD-compatible install... /usr/bin/install -c checking for i686-w64-mingw32-g++... i686-w64-mingw32-g++ configure: creating ./config.status config.status: creating Makefile c++wrap -fno-exceptions -fno-rtti -O2 -g -fno-threadsafe-statics -fno-rtti -fno-exceptions -Wall -Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0 -c -o cygpath.o /c/dev/sdc1/cygwin/src/winsup/utils/cygpath.cc make: *** No rule to make target '/c/dev/sdc1/cygwin/build/winsup/cygwin/Makefile', needed by '/c/dev/sdc1/cygwin/build/winsup/cygwin/libcygwin.a'. Stop. An attempt to rebuild whole suite crashes more epically. make[2]: Entering directory '/c/dev/sdc1/cygwin/build/binutils' gcc -c -I. -I/c/dev/sdc1/cygwin/src/binutils -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -Wno-error /c/dev/sdc1/cygwin/src/binutils/syslex_wrap.c In file included from /c/dev/sdc1/cygwin/src/binutils/syslex_wrap.c:25:0: syslex.l: In function 'yylex': syslex.l:55:2: error: 'yylval' undeclared (first use in this function) syslex.l:55:2: note: each undeclared identifier is reported only once for each function it appears in syslex.l:58:16: error: 'NAME' undeclared (first use in this function) In file included from /c/dev/sdc1/cygwin/src/binutils/syslex_wrap.c:25:0: syslex.l:63:10: error: 'NUMBER' undeclared (first use in this function) In file included from /c/dev/sdc1/cygwin/src/binutils/syslex_wrap.c:25:0: syslex.l:72:23: error: 'UNIT' undeclared (first use in this function) In file included from /c/dev/sdc1/cygwin/src/binutils/syslex_wrap.c:25:0: syslex.l:77:28: error: 'TYPE' undeclared (first use in this function) In file included from /c/dev/sdc1/cygwin/src/binutils/syslex_wrap.c:25:0: syslex.l:84:10: error: 'COND' undeclared (first use in this function) In file included from /c/dev/sdc1/cygwin/src/binutils/syslex_wrap.c:25:0: syslex.l:85:10: error: 'REPEAT' undeclared (first use in this function) In file included from /c/dev/sdc1/cygwin/src/binutils/syslex_wrap.c:25:0: syslex.c: In function 'yy_get_next_buffer': syslex.c:641:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for ( n = 0; n < max_size && \ ^ syslex.c:1175:3: note: in expansion of macro 'YY_INPUT' YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), ^ Makefile:1332: recipe for target 'syslex_wrap.o' failed make[2]: *** [syslex_wrap.o] Error 1 make[2]: Leaving directory '/c/dev/sdc1/cygwin/build/binutils' Makefile:3485: recipe for target 'all-binutils' failed make[1]: *** [all-binutils] Error 2 make[1]: Leaving directory '/c/dev/sdc1/cygwin/build' Makefile:833: recipe for target 'all' failed make: *** [all] Error 2 I know I'm doing something wrong, but hell if I know, what... P.P.S. I've sent a reply with some interesting discoveries to the "new cygwin1" thread, but it didn't made it to the list, and I did not receive a bounce either. Should I bug cygwin-owner about it? Message-id is 41636493.20140214234...@mtu-net.ru -- WBR, Andrey Repin (anrdae...@yandex.ru) 15.02.2014, <20:04> Sorry for my terrible english... -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple