Hello community, here is the log from the commit of package vifm for openSUSE:Factory checked in at 2016-07-18 21:25:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/vifm (Old) and /work/SRC/openSUSE:Factory/.vifm.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "vifm" Changes: -------- --- /work/SRC/openSUSE:Factory/vifm/vifm.changes 2016-07-05 09:51:55.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.vifm.new/vifm.changes 2016-07-18 21:25:57.000000000 +0200 @@ -1,0 +2,20 @@ +Sat Jul 16 21:25:38 UTC 2016 - mvet...@suse.com + +- Update to version 0.8.2: + * key suggestions in the interface on ambiguous input (e.g. "g"); + * helpful shortcuts for dialogs (for sort dialog in particular); + * key descriptions in :map menus and %z macro for 'statusline' to display some tips; + * description of all :commands, 'options' and their values for new multiline +version of wildmenu; + * ANDing, ORing and negating patterns for matching files and new mime-type +matcher; + * file prefixes and suffixes can now be multi-byte, which with extended +'classify' option allows specifying "icons" via custom fonts; + * search result highlighting, enabled completion and a way to export the list +for menus; + * an indication of pattern correctness and match state for interactive prompts. + * :select and :unselect commands to perform automatic file selection (possibly + by using output of external application); + * cancellation (handling of Ctrl-C) for quick view and view mode loading. + +------------------------------------------------------------------- Old: ---- vifm-0.8.2-beta.tar.bz2 New: ---- vifm-0.8.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ vifm.spec ++++++ --- /var/tmp/diff_new_pack.tXIXy8/_old 2016-07-18 21:25:58.000000000 +0200 +++ /var/tmp/diff_new_pack.tXIXy8/_new 2016-07-18 21:25:58.000000000 +0200 @@ -16,15 +16,14 @@ # -%define _version 0.8.2-beta Name: vifm -Version: 0.8.2~beta1 +Version: 0.8.2 Release: 0 Summary: Ncurses based file manager with vi like keybindings License: GPL-2.0+ Group: Productivity/File utilities Url: http://%{name}.info -Source: http://prdownloads.sourceforge.net/%{name}/%{name}-%{_version}.tar.bz2 +Source: http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 BuildRequires: file-devel BuildRequires: groff BuildRequires: ncurses-devel @@ -46,7 +45,7 @@ and configurable color schemes. %prep -%setup -q -n vifm-0.8.2-beta +%setup -q %build %configure \ ++++++ vifm-0.8.2-beta.tar.bz2 -> vifm-0.8.2.tar.bz2 ++++++ ++++ 1610 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/ChangeLog new/vifm-0.8.2/ChangeLog --- old/vifm-0.8.2-beta/ChangeLog 2016-07-02 10:54:06.000000000 +0200 +++ new/vifm-0.8.2/ChangeLog 2016-07-16 13:39:13.000000000 +0200 @@ -1,3 +1,15 @@ +0.8.2-beta to 0.8.2 + + Added support for matchit to filetype plugin. Patch by filterfalse. + + Fixed processing of root directory (completion, :cd). Thanks to + filterfalse. + + Fixed completion of commands after :!. Thanks to filterfalse. + + Fixed formatting/wording/outdated notes in documentation. Patches by + filterfalse. + 0.8.1a to 0.8.2-beta Added highlighting of search matches in menus. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/NEWS new/vifm-0.8.2/NEWS --- old/vifm-0.8.2-beta/NEWS 2016-07-02 10:54:16.000000000 +0200 +++ new/vifm-0.8.2/NEWS 2016-07-16 13:39:22.000000000 +0200 @@ -1,3 +1,183 @@ +July 16, 2016 +============= + +vifm v0.8.2 +----------- + +This release brings a bit of user-friendliness in form of key suggestions and +various descriptions provided in the interface. Matching of files has been +extended in many ways and become significantly more powerful than before. +Menu mode also got several enhancements. + +Thanks to everyone who found time to try the beta. + +Main changes: + - key suggestions in the interface on ambiguous input (e.g. "g"); + - helpful shortcuts for dialogs (for sort dialog in particular); + - key descriptions in :map menus and %z macro for 'statusline' to display some + tips; + - description of all :commands, 'options' and their values for new multiline + version of wildmenu; + - ANDing, ORing and negating patterns for matching files and new mime-type + matcher; + - file prefixes and suffixes can now be multi-byte, which with extended + 'classify' option allows specifying "icons" via custom fonts; + - search result highlighting, enabled completion and a way to export the list + for menus; + - an indication of pattern correctness and match state for interactive prompts. + - :select and :unselect commands to perform automatic file selection (possibly + by using output of external application); + - cancellation (handling of Ctrl-C) for quick view and view mode loading. + +Not sure if it was noticed, but HTTPS protocol is up for related sites since +Let's Encrypt started their beta. Everything works fine, so all the links were +updated to https protocol. + +If you ever wondered which keys are builtin for the command (normal) mode of +Vifm, this cheatsheet will show you: https://next.vifm.info/cheatsheets.shtml + +In case you're into using neovim, you might be interesting into checking out +alternative Vifm plugin for it: https://github.com/vifm/neovim-vifm + +More detailed list of changes. + +Core: + - added heuristic that uses null byte as separator for file lists if there is + at least one such byte, otherwise normal line separators are used. This + affects :[un]select, `vifm -`, %u, %U, %m and %M (thanks to filterfalse); + - changed order of initialization to perform autocommands before startup + commands on launch. + +Normal and visual modes: + - changed ga/gA effect on parent entry (..) to calculate size of current + directory (thanks to aleksejrs). + +:set command and options: + - added 'wildstyle' option to control the way wild menu is displayed. Enables + displaying it as a menu with one item per line (thanks to santhoshr and + octos); + - added 'suggestoptions' option to control displaying of suggestions; + - added support of patterns to 'classify' option, so that files can now be + decorated based on their names (thanks to elricbk); + - added 'cvoptions' option to control when entering/leaving custom views is + considered to be equal to entering/leaving directories (thanks to + filterfalse); + - added "target" sorting key, which sorts files by symbolic link targets + (thanks to Marcos Cruz); + - added %z 'statusline' macro that inserts text of a short tip picked at random + (thanks to qinghao, a.k.a. haobug); + - changed type of 'confirm' option. Now it's a set that picks which operations + should be confirmed (thanks to Losiara and mvucBmM0); + - allow suffixes and prefixes in 'classify' to be of up to eight characters in + length (thanks to elricbk). + +Command-line mode: + - added "filelist" parameter to :sync! that enables synchronization of custom + view (thanks to filterfalse); + - added :select and :unselect commands (thanks to filterfalse, Russell Urquhart + and Marcos Cruz); + - added negation to patterns with explicitly specified type (surrounded by {} + or //). Put exclamation mark to invert pattern match (thanks to Marcos + Cruz); + - added mime type patterns ([!]<list-of-globs>) (thanks to Ross Hadden, a.k.a. + rosshadden); + - added pattern ANDing. Just list decorated patterns one after another and + such composite pattern will much when each of them matches (thanks to + filterfalse); + - added pattern ORing for :file[x]type and :fileviewer commands implemented as + a comma-separated list (thanks to filterfalse); + - expand environment variables for :edit (thanks to filterfalse); + - don't print just table header on `:cabbr something`, print message that no + matches found instead; + - use original (before custom view) cursor position on :sync! in custom views + (thanks to filterfalse). + +File preview: + - added cancellation (handling of Ctrl-C) for quick view and view mode loading + (thanks to kalterfive); + - skip UTF-8 BOM for file preview. + +File list: + - never add parent entry (..) to very custom view (%U) (thanks to filterfalse); + - silently ignore tries to remove parent entry (..) (thanks to aleksejrs); + - automatically update custom view entries on rename of their parent directory + in the same custom view. + +Completion: + - added completion of :wincmd argument; + - do not reset completion on terminal resize; + - some corrections of when completion happens for :find and :grep. + +Scripting: + - added chooseopt() builtin function that retrieves various parameters of file + choosing (thanks to Von Welch). + +Menus and dialogs: + - added highlighting of search matches in menus; + - added :noh[lsearch] command to menu mode; + - added quick shortcuts to dialogs (patch by oo-); + - added description of builtin keys to :map menus; + - added :write command to menus, that writes all menu lines into specified file + (thanks to gtors); + - a bit better delete confirmation messages with number of files to be deleted; + - avoid displaying useless search messages about incorrect pattern during + interactive search in menus (those that user can't see, but that are shown in + :messages); + - enabled wildmenu for menus. + +TUI (Text User Interface): + - added indication of wrong pattern and absence of matches to command-prompt + for interactive search/filtering. + +Angle bracket notation: + - display <c-h> as <bs> only at the beginning of key sequence. + +Color schemes: + - added SuggestBox highlight group for key suggestion box. + +Vim-plugin: + - added support for matchit to filetype plugin (patch by filterfalse); + - better terminal buffer title for plugin in neovim (thanks to + randomizedthinking); + - improved syntax highlighting of patterns. + +Only on Windows: + - fixed escaping for cmd.exe again, for :edit and external command invocations + (thanks to Reva Revadigar); + - fixed querying file information on 64-bit Windows (thanks to santhoshr); + - fixed possible crash on displaying job bar (e.g. after :empty) (thanks to + Reva Revadigar); + - fixed UTF8 <-> UTF16 conversion, which didn't always work (on surrogate + characters it seems) (thanks to Reva Revadigar); + - fixed possible unexpectedly long timeouts when waiting for a key (due to + limitation of pdcurses); + - fixed displaying of wide (CJK) characters in pdcurses (thanks to Reva + Revadigar); + - fixed capturing output of external applications when 'shell' is "cmd". Was + broken since v0.8 in an attempt to make cmd work better with Unicode (but its + /U flag affects only input and output streams). + +Packaging: + - fixed functioning on architectures on which `char` is unsigned by default + (thanks to Ondrej Novy, a.k.a. onovy). + +Important fixes: + - fixed hanging on sudden terminal loss (regression) (thanks to aleksejrs); + - fixed using original file names after a prompt for new destination name + (thanks to rbong); + - fixed unconditional resetting of executable permission when using cp dialog + (thanks to Svyatoslav Mishyn, a.k.a. juef); + - fixed remote feature on cygwin (thanks to Cosmin Popescu, a.k.a. + cosminadrianpopescu); + - fixed epic bug in processing selectors followed by other commands in a + mapping. Command which accepted selector was called after tail of sequence + is processed. Such case isn't very likely, so it probably didn't affect + anyone. + +See change log for the full list of changes and by whom they were suggested. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + July 02, 2016 ============= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/README new/vifm-0.8.2/README --- old/vifm-0.8.2-beta/README 2016-07-02 10:54:16.000000000 +0200 +++ new/vifm-0.8.2/README 2016-07-16 13:39:22.000000000 +0200 @@ -1,8 +1,8 @@ Vifm - vi[m] like file manager 2001 - 2016 -Updated: 02 July, 2016 -Version: 0.8.2-beta +Updated: 16 July, 2016 +Version: 0.8.2 Brief Description diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/TODO new/vifm-0.8.2/TODO --- old/vifm-0.8.2-beta/TODO 2016-06-19 20:37:26.000000000 +0200 +++ new/vifm-0.8.2/TODO 2016-07-10 11:49:20.000000000 +0200 @@ -120,6 +120,7 @@ * Update visible symlinks in the other pane on updating current pane. * Try drawing progress bar in progress dialog. * Mouse support. (partially done) + * Asynchronous quick preview? * Possibility to make colorful background per column. * Add a key to menu mode to repeat command and update menu. * Extract vim plugin part of install to vifm.vim README. @@ -161,6 +162,7 @@ * Add :keepsel prefix. * Consider asking more often before performing file operations. * Termcap or terminfo support for keybindings + * Shorten home path to ~ in item origins? * Add :increment and :decrement commands. * Consider changing "dd" to "d" in menus. * Consider caching directory sizes in vifminfo. @@ -202,6 +204,7 @@ * Consider using curses panes, not just windows. * Show "An error occurred" message on fail to build menus. * Consider not using {} initializer. + * Use timeout command to set time limit for tests on CI. * Note skipped tests in the tests output. * Pass var by pointer to var_free and cleanup the structure. * Logging levels. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/configure.ac new/vifm-0.8.2/configure.ac --- old/vifm-0.8.2-beta/configure.ac 2016-07-02 10:54:06.000000000 +0200 +++ new/vifm-0.8.2/configure.ac 2016-07-16 13:39:13.000000000 +0200 @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(vifm, 0.8.2-beta, xai...@openmailbox.org, vifm, https://vifm.info) +AC_INIT(vifm, 0.8.2, xai...@openmailbox.org, vifm, https://vifm.info) AC_CONFIG_SRCDIR(configure.ac) AM_INIT_AUTOMAKE([no-dist-gzip dist-bzip2]) AM_CONFIG_HEADER(config.h) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/data/man/vifm-convert-dircolors.1 new/vifm-0.8.2/data/man/vifm-convert-dircolors.1 --- old/vifm-0.8.2-beta/data/man/vifm-convert-dircolors.1 2016-07-02 10:54:16.000000000 +0200 +++ new/vifm-0.8.2/data/man/vifm-convert-dircolors.1 2016-07-16 13:39:22.000000000 +0200 @@ -1,4 +1,4 @@ -.TH VIFM\-CONVERT\-DIRCOLORS 1 "July 02, 2016" "vifm 0.8.2-beta" +.TH VIFM\-CONVERT\-DIRCOLORS 1 "July 16, 2016" "vifm 0.8.2" .\" --------------------------------------------------------------------------- .SH "NAME" .\" --------------------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/data/man/vifm-pause.1 new/vifm-0.8.2/data/man/vifm-pause.1 --- old/vifm-0.8.2-beta/data/man/vifm-pause.1 2016-07-02 10:54:16.000000000 +0200 +++ new/vifm-0.8.2/data/man/vifm-pause.1 2016-07-16 13:39:22.000000000 +0200 @@ -1,4 +1,4 @@ -.TH "VIFM-PAUSE" "1" "July 02, 2016" "vifm 0.8.2-beta" +.TH "VIFM-PAUSE" "1" "July 16, 2016" "vifm 0.8.2" .\" --------------------------------------------------------------------------- .SH "NAME" .\" --------------------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/data/man/vifm-screen-split.1 new/vifm-0.8.2/data/man/vifm-screen-split.1 --- old/vifm-0.8.2-beta/data/man/vifm-screen-split.1 2016-07-02 10:54:16.000000000 +0200 +++ new/vifm-0.8.2/data/man/vifm-screen-split.1 2016-07-16 13:39:22.000000000 +0200 @@ -1,4 +1,4 @@ -.TH "VIFM-SCREEN-SPLIT" "1" "July 02, 2016" "vifm 0.8.2-beta" +.TH "VIFM-SCREEN-SPLIT" "1" "July 16, 2016" "vifm 0.8.2" .\" --------------------------------------------------------------------------- .SH "NAME" .\" --------------------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/data/man/vifm.1 new/vifm-0.8.2/data/man/vifm.1 --- old/vifm-0.8.2-beta/data/man/vifm.1 2016-07-02 10:54:16.000000000 +0200 +++ new/vifm-0.8.2/data/man/vifm.1 2016-07-16 16:58:53.000000000 +0200 @@ -1,4 +1,4 @@ -.TH VIFM 1 "July 02, 2016" "vifm 0.8.2-beta" +.TH VIFM 1 "July 16, 2016" "vifm 0.8.2" .\" --------------------------------------------------------------------------- .SH NAME .\" --------------------------------------------------------------------------- @@ -1741,12 +1741,13 @@ .BI " :fileviewer" .TP .BI ":filev[iewer] pattern-list command1,command2,..." -register specified list of commands as viewers for each of the patterns. Viewer -is a command which output is captured and displayed in the second pane of vifm -after running :view command. When the command doesn't contain any of vifm -macros, name of current file is appended as if command ended with %c macro. -Comma escaping and missing commands processing rules as for :filetype apply to -this command. See "Patterns" section below for pattern definition. +register specified list of commands as viewers for each of the patterns. +Viewer is a command which output is captured and displayed in one of the panes +of vifm after pressing "e" or running :view command. When the command doesn't +contain any of vifm macros, name of current file is appended as if command +ended with %c macro. Comma escaping and missing commands processing rules as +for :filetype apply to this command. See "Patterns" section below for pattern +definition. Example for zip archives: .EX @@ -4011,7 +4012,7 @@ a base. Value of this option is ignored if 'lsview' is set. See "Column view" section below for format description. -An example of setting the options for both panes (note vifm-windo command): +An example of setting the options for both panes (note :windo command): .EX windo set viewcolumns=-{name}..,6{size},11{perms} @@ -5378,10 +5379,6 @@ vifm \-\-remote ~ vifm \-\-remote /usr/bin /tmp .EE - -At the moment there is no way of specifying, which instance of vifm should -arguments be sent. The main purpose of \-\-remote argument is to provide -support of using vifm as a single-instance application. .\" --------------------------------------------------------------------------- .SH Plugin .\" --------------------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/data/vim/doc/app/vifm-app.txt new/vifm-0.8.2/data/vim/doc/app/vifm-app.txt --- old/vifm-0.8.2-beta/data/vim/doc/app/vifm-app.txt 2016-07-02 10:54:16.000000000 +0200 +++ new/vifm-0.8.2/data/vim/doc/app/vifm-app.txt 2016-07-16 16:58:53.000000000 +0200 @@ -1,4 +1,4 @@ -*vifm-app.txt* For Vifm version 0.8.2-beta Last change: 2016 Jul 02 +*vifm-app.txt* For Vifm version 0.8.2 Last change: 2016 Jul 16 Email for bugs and suggestions: <xai...@openmailbox.org> @@ -1482,12 +1482,12 @@ *vifm-:fileviewer* *vifm-:filev* :filev[iewer] pattern-list command1,command2,... register specified list of commands as viewers for each of the patterns. - Viewer is a command which output is captured and displayed in the second - pane of vifm after running |vifm-:view| command. When the command doesn't - contain any of vifm macros, name of current file is appended as if command - ended with |vifm-%c| macro. Comma escaping and missing commands processing - rules as for |vifm-:filetype| apply to this command. See |vifm-globs| for - pattern definition. + Viewer is a command which output is captured and displayed in one of the + panes of vifm after pressing |vifm-e| or running |vifm-:view| command. + When the command doesn't contain any of vifm macros, name of current file + is appended as if command ended with |vifm-%c| macro. Comma escaping and + missing commands processing rules as for |vifm-:filetype| apply to this + command. See |vifm-globs| for pattern definition. Example for zip archives: > @@ -3348,7 +3348,7 @@ empty view columns to show are chosen automatically using sorting keys (see |vifm-'sort'|) as a base. Value of this option is ignored if |vifm-'lsview'| is set. See |vifm-column-view| for format description. -An example of setting the options for both panes (note |vifm-windo| +An example of setting the options for both panes (note |vifm-:windo| command): > windo set viewcolumns=-{name}..,6{size},11{perms} < @@ -4522,10 +4522,6 @@ vifm --remote / vifm --remote ~ vifm --remote /usr/bin /tmp -< -At the moment there is no way of specifying, which instance of vifm should -arguments be sent. The main purpose of --remote argument is to provide -support of using vifm as a single-instance application. -------------------------------------------------------------------------------- *vifm-plugin* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/data/vim/doc/plugin/vifm-plugin.txt new/vifm-0.8.2/data/vim/doc/plugin/vifm-plugin.txt --- old/vifm-0.8.2-beta/data/vim/doc/plugin/vifm-plugin.txt 2016-07-02 10:54:16.000000000 +0200 +++ new/vifm-0.8.2/data/vim/doc/plugin/vifm-plugin.txt 2016-07-16 13:39:22.000000000 +0200 @@ -1,4 +1,4 @@ -*vifm-plugin.txt* For Vifm version 0.8.2-beta Last change: 2016 Jul 02 +*vifm-plugin.txt* For Vifm version 0.8.2 Last change: 2016 Jul 16 Email for bugs and suggestions: <xai...@openmailbox.org> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/data/vim/ftplugin/vifm.vim new/vifm-0.8.2/data/vim/ftplugin/vifm.vim --- old/vifm-0.8.2-beta/data/vim/ftplugin/vifm.vim 2015-06-08 10:02:53.000000000 +0200 +++ new/vifm-0.8.2/data/vim/ftplugin/vifm.vim 2016-07-10 11:49:20.000000000 +0200 @@ -1,6 +1,6 @@ " vifmrc filetype plugin " Maintainer: xaizek <xai...@openmailbox.org> -" Last Change: August 18, 2011 +" Last Change: July 08, 2016 " Based On: Vim file type file by Bram Moolenaar if exists("b:did_ftplugin") @@ -34,6 +34,12 @@ nnoremap <silent><buffer> [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR> vnoremap <silent><buffer> [" :<C-U>exe "normal! gv"<Bar>call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR> +" Let the matchit plugin know what items can be matched. +if exists("loaded_matchit") + let b:match_ignorecase = 0 + let b:match_words = '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>' +endif + let &cpo = s:cpo_save unlet s:cpo_save diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/src/Makefile.win new/vifm-0.8.2/src/Makefile.win --- old/vifm-0.8.2-beta/src/Makefile.win 2016-07-02 10:54:16.000000000 +0200 +++ new/vifm-0.8.2/src/Makefile.win 2016-07-16 13:39:22.000000000 +0200 @@ -121,7 +121,7 @@ ../config.h: @echo Creating sample ../config.h - echo '#define VERSION "0.8.2-beta"' > ../config.h; \ + echo '#define VERSION "0.8.2"' > ../config.h; \ echo '#define ENABLE_EXTENDED_KEYS' >> ../config.h; \ echo '#define _GNU_SOURCE 1' >> ../config.h; \ echo '#define PACKAGE_SYSCONF_DIR ""' >> ../config.h; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/src/cmd_completion.c new/vifm-0.8.2/src/cmd_completion.c --- old/vifm-0.8.2-beta/src/cmd_completion.c 2016-06-28 13:28:06.000000000 +0200 +++ new/vifm-0.8.2/src/cmd_completion.c 2016-07-06 22:02:38.000000000 +0200 @@ -89,8 +89,8 @@ static void complete_command_name(const char beginning[]); static void filename_completion_in_dir(const char *path, const char *str, CompletionType type); -static void filename_completion_internal(DIR *dir, const char dirname[], - const char filename[], CompletionType type); +static void filename_completion_internal(DIR *dir, const char filename[], + CompletionType type); static int is_dirent_targets_exec(const struct dirent *d); #ifdef _WIN32 static void complete_with_shared(const char *server, const char *file); @@ -326,7 +326,7 @@ } else if(id == COM_GREP) { - if(earg_num(argc, args) >= 1 && args[0] == '-') + if(earg_num(argc, args) > 1 && args[0] == '-') { filename_completion(arg, CT_DIRONLY, 1); } @@ -808,7 +808,7 @@ { if(vifm_chdir(paths[i]) == 0) { - filename_completion(beginning, CT_EXECONLY, 0); + filename_completion(beginning, CT_EXECONLY, 1); } } vle_compl_add_last_path_match(beginning); @@ -865,7 +865,7 @@ strcpy(filename, ++temp); *temp = '\0'; } - else if(replace_string(&dirname, flist_get_dir(curr_view)) != 0) + else if(replace_string(&dirname, ".") != 0) { free(filename); free(dirname); @@ -928,7 +928,7 @@ } else { - filename_completion_internal(dir, dirname, filename, type); + filename_completion_internal(dir, filename, type); (void)vifm_chdir(flist_get_dir(curr_view)); } @@ -944,8 +944,8 @@ } static void -filename_completion_internal(DIR *dir, const char dirname[], - const char filename[], CompletionType type) +filename_completion_internal(DIR *dir, const char filename[], + CompletionType type) { struct dirent *d; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/src/int/path_env.c new/vifm-0.8.2/src/int/path_env.c --- old/vifm-0.8.2-beta/src/int/path_env.c 2016-06-03 20:59:17.000000000 +0200 +++ new/vifm-0.8.2/src/int/path_env.c 2016-07-15 21:07:27.000000000 +0200 @@ -196,7 +196,7 @@ q = p + strlen(p); } - s = malloc(q - p + 1); + s = malloc(q - p + 1U); if(s == NULL) { free_string_array(paths, i - 1); @@ -204,7 +204,7 @@ paths_count = 0; return; } - snprintf(s, q - p + 1, "%s", p); + copy_str(s, q - p + 1U, p); p = q; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/src/ipc.c new/vifm-0.8.2/src/ipc.c --- old/vifm-0.8.2-beta/src/ipc.c 2016-06-04 15:56:18.000000000 +0200 +++ new/vifm-0.8.2/src/ipc.c 2016-07-15 21:07:27.000000000 +0200 @@ -435,9 +435,8 @@ while(*data != NULL) { - strcpy(pkg + len, *data); - len += strlen(*data) + 1; - data++; + len += copy_str(pkg + len, sizeof(pkg) - len, *data); + ++data; } pkg[len++] = '\0'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/src/running.c new/vifm-0.8.2/src/running.c --- old/vifm-0.8.2-beta/src/running.c 2016-06-04 15:56:18.000000000 +0200 +++ new/vifm-0.8.2/src/running.c 2016-07-10 11:49:20.000000000 +0200 @@ -1320,7 +1320,7 @@ free(escaped_cmd); } -void +int output_to_custom_flist(FileView *view, const char cmd[], int very) { char *title; @@ -1338,10 +1338,11 @@ if(error) { show_error_msgf("Trouble running command", "Unable to run: %s", cmd); - return; + return 1; } flist_end_custom(view, very); + return 0; } /* Implements process_cmd_output() callback that loads paths into custom diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/src/running.h new/vifm-0.8.2/src/running.h --- old/vifm-0.8.2-beta/src/running.h 2016-05-17 18:46:40.000000000 +0200 +++ new/vifm-0.8.2/src/running.h 2016-07-10 11:49:20.000000000 +0200 @@ -74,8 +74,9 @@ int run_ext_command(const char cmd[], MacroFlags flags, int bg, int *save_msg); /* Runs the cmd and parses its output as list of paths to compose custom view. - * Very custom view implies unsorted list. */ -void output_to_custom_flist(FileView *view, const char cmd[], int very); + * Very custom view implies unsorted list. Returns zero on success, otherwise + * non-zero is returned. */ +int output_to_custom_flist(FileView *view, const char cmd[], int very); /* Executes external command capturing its output as list of lines. Sets *files * and *nfiles. Returns zero on success, otherwise non-zero is returned. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/src/utils/path.c new/vifm-0.8.2/src/utils/path.c --- old/vifm-0.8.2-beta/src/utils/path.c 2016-06-20 14:37:05.000000000 +0200 +++ new/vifm-0.8.2/src/utils/path.c 2016-07-06 22:02:38.000000000 +0200 @@ -590,7 +590,10 @@ canonicalize_path(path, buf, buf_len); } - chosp(buf); + if(!is_root_dir(buf)) + { + chosp(buf); + } } int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/src/utils/path.h new/vifm-0.8.2/src/utils/path.h --- old/vifm-0.8.2-beta/src/utils/path.h 2016-06-19 23:08:03.000000000 +0200 +++ new/vifm-0.8.2/src/utils/path.h 2016-07-06 22:02:38.000000000 +0200 @@ -93,8 +93,8 @@ void ensure_path_well_formed(char *path); /* Ensures that path to a file is of canonic absolute form. No trailing slash - * in the buffer. Canonic paths must be absolute, so if input path isn't base - * is prepended to it. */ + * in the buffer except for the root path. Canonic paths must be absolute, so + * if input path isn't base is prepended to it. */ void to_canonic_path(const char path[], const char base[], char buf[], size_t buf_len); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/src/utils/str.c new/vifm-0.8.2/src/utils/str.c --- old/vifm-0.8.2-beta/src/utils/str.c 2016-06-28 13:28:06.000000000 +0200 +++ new/vifm-0.8.2/src/utils/str.c 2016-07-15 21:07:27.000000000 +0200 @@ -825,7 +825,7 @@ size_t copy_str(char dst[], size_t dst_len, const char src[]) { - /* XXX: shouldn't we return "strlen(src)" instead "0U"? */ + /* XXX: shouldn't we return "strlen(src)" instead of "0U"? */ return (dst == src) ? 0U : copy_substr(dst, dst_len, src, '\0'); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/src/utils/string_array.c new/vifm-0.8.2/src/utils/string_array.c --- old/vifm-0.8.2-beta/src/utils/string_array.c 2016-07-01 18:00:46.000000000 +0200 +++ new/vifm-0.8.2/src/utils/string_array.c 2016-07-15 21:07:27.000000000 +0200 @@ -174,12 +174,6 @@ } } -void -free_wstring_array(wchar_t **array, size_t len) -{ - free_string_array((char **)array, len); -} - char ** read_file_of_lines(const char filepath[], int *nlines) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/src/utils/string_array.h new/vifm-0.8.2/src/utils/string_array.h --- old/vifm-0.8.2-beta/src/utils/string_array.h 2016-06-02 20:23:28.000000000 +0200 +++ new/vifm-0.8.2/src/utils/string_array.h 2016-07-15 21:07:27.000000000 +0200 @@ -70,8 +70,6 @@ /* Frees memory of all array items, but not from the array itself. */ void free_strings(char *array[], size_t len); -void free_wstring_array(wchar_t **array, size_t len); - /* Reads file specified by filepath into an array of strings. Returns non-NULL * on success, otherwise NULL is returned, *nlines is untouched and errno * contains error code. For empty file non-NULL will be returned, but *nlines diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/Makefile new/vifm-0.8.2/tests/Makefile --- old/vifm-0.8.2-beta/tests/Makefile 2016-07-02 10:18:50.000000000 +0200 +++ new/vifm-0.8.2/tests/Makefile 2016-07-10 11:49:20.000000000 +0200 @@ -180,7 +180,7 @@ check: build clean: - $(RM) -r $(B)bin/ $(B)sandbox/ + $(RM) -r $(B)bin/ $(SANDBOX_PATH)/ $(RM) $(B)stic/stic.h.d $(B)stic/stic.h.gch # disable implicit rules to prevent compiling main sources here @@ -248,7 +248,7 @@ $$(LD) -o $$@ $$^ $(LDFLAGS) $(BUILD)$1/%.o: $1/%.c $(B)stic/stic.h.gch $(BUILD)$1/filelist \ - | $(BUILD)$1 $(B)sandbox/$1 + | $(BUILD)$1 $(SANDBOX_PATH)/$1 $$(CC) -c -o $$@ -include stic/stic.h $(CFLAGS) \ -DTESTID=$$(call pos, $$($1.obj), $$@) \ -DMAXTESTID=$$(words $$($1.obj)) $$< \ @@ -261,7 +261,7 @@ echo -n '$$($1.src)' > $$@; \ fi -$(BUILD)$1 $(B)sandbox/$1: +$(BUILD)$1 $(SANDBOX_PATH)/$1: $(AT)mkdir -p $$@ $1: $$($1.bin) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/filetype/filetype.c new/vifm-0.8.2/tests/filetype/filetype.c --- old/vifm-0.8.2-beta/tests/filetype/filetype.c 2016-05-28 19:09:45.000000000 +0200 +++ new/vifm-0.8.2/tests/filetype/filetype.c 2016-07-04 18:32:28.000000000 +0200 @@ -2,8 +2,10 @@ #include <stdlib.h> +#include "../../src/int/file_magic.h" #include "../../src/filetype.h" #include "../../src/status.h" + #include "test.h" TEST(one_pattern) @@ -152,7 +154,11 @@ TEST(pattern_list, IF(has_mime_type_detection)) { - set_programs("<application/octet-stream>{binary-data}", "prog", 0, 0); + char cmd[1024]; + + snprintf(cmd, sizeof(cmd), "<%s>{binary-data}", + get_mimetype(TEST_DATA_PATH "/read/binary-data")); + set_programs(cmd, "prog", 0, 0); assert_string_equal("prog", ft_get_program(TEST_DATA_PATH "/read/binary-data")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/filetype/viewers.c new/vifm-0.8.2/tests/filetype/viewers.c --- old/vifm-0.8.2-beta/tests/filetype/viewers.c 2016-05-28 19:09:45.000000000 +0200 +++ new/vifm-0.8.2/tests/filetype/viewers.c 2016-07-04 18:32:03.000000000 +0200 @@ -3,6 +3,7 @@ #include <stdlib.h> #include <string.h> +#include "../../src/int/file_magic.h" #include "../../src/filetype.h" #include "../../src/status.h" #include "../../src/utils/str.h" @@ -94,7 +95,11 @@ TEST(pattern_list, IF(has_mime_type_detection)) { - set_viewers("<application/octet-stream>{binary-data}", "prog1"); + char cmd[1024]; + + snprintf(cmd, sizeof(cmd), "<%s>{binary-data}", + get_mimetype(TEST_DATA_PATH "/read/binary-data")); + set_viewers(cmd, "prog1"); ft_init(&prog1_available); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/misc/autocmds.c new/vifm-0.8.2/tests/misc/autocmds.c --- old/vifm-0.8.2-beta/tests/misc/autocmds.c 2016-05-09 16:51:08.000000000 +0200 +++ new/vifm-0.8.2/tests/misc/autocmds.c 2016-07-06 22:02:38.000000000 +0200 @@ -16,8 +16,6 @@ #include "utils.h" -static int not_windows(void); - static char sandbox[PATH_MAX]; static char test_data[PATH_MAX]; static char cmd[PATH_MAX]; @@ -332,15 +330,5 @@ assert_success(rmdir(path)); } -static int -not_windows(void) -{ -#ifdef _WIN32 - return 0; -#else - return 1; -#endif -} - /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/misc/builtin_functions.c new/vifm-0.8.2/tests/misc/builtin_functions.c --- old/vifm-0.8.2-beta/tests/misc/builtin_functions.c 2016-07-02 10:25:57.000000000 +0200 +++ new/vifm-0.8.2/tests/misc/builtin_functions.c 2016-07-16 11:27:33.000000000 +0200 @@ -1,7 +1,7 @@ #include <stic.h> #include <stddef.h> /* NULL */ -#include <stdlib.h> /* free() */ +#include <stdlib.h> /* free() remove() */ #include <string.h> /* strdup() */ #include "../../src/cfg/config.h" @@ -40,7 +40,14 @@ TEST(executable_true_for_executable) { - ASSERT_INT_OK("executable('" SANDBOX_PATH "/../../../src/vifm')", 1); + const char *const exec_file = SANDBOX_PATH "/exec-for-completion" EXE_SUFFIX; + + create_executable(exec_file); + + ASSERT_INT_OK( + "executable('" SANDBOX_PATH "/exec-for-completion" EXE_SUFFIX "')", 1); + + assert_success(remove(exec_file)); } TEST(executable_false_for_regular_file) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/misc/chase_links.c new/vifm-0.8.2/tests/misc/chase_links.c --- old/vifm-0.8.2-beta/tests/misc/chase_links.c 2016-06-28 13:28:06.000000000 +0200 +++ new/vifm-0.8.2/tests/misc/chase_links.c 2016-07-16 11:27:33.000000000 +0200 @@ -17,9 +17,10 @@ #include "../../src/utils/str.h" #include "../../src/cmd_core.h" +#include "utils.h" + static void init_view(FileView *view); static void free_view(FileView *view); -static int not_windows(void); SETUP() { @@ -145,15 +146,5 @@ assert_success(remove("dir-link")); } -static int -not_windows(void) -{ -#ifdef _WIN32 - return 0; -#else - return 1; -#endif -} - /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/misc/cmdline_completion.c new/vifm-0.8.2/tests/misc/cmdline_completion.c --- old/vifm-0.8.2-beta/tests/misc/cmdline_completion.c 2016-07-02 10:25:57.000000000 +0200 +++ new/vifm-0.8.2/tests/misc/cmdline_completion.c 2016-07-16 13:38:49.000000000 +0200 @@ -5,7 +5,7 @@ #include <stddef.h> /* NULL */ #include <stdlib.h> /* fclose() fopen() free() */ -#include <string.h> +#include <string.h> /* strdup() */ #include <wchar.h> /* wcsdup() */ #include "../../src/compat/fs_limits.h" @@ -16,6 +16,7 @@ #include "../../src/engine/completion.h" #include "../../src/engine/functions.h" #include "../../src/engine/options.h" +#include "../../src/int/path_env.h" #include "../../src/modes/cmdline.h" #include "../../src/utils/env.h" #include "../../src/utils/fs.h" @@ -27,18 +28,8 @@ #include "utils.h" -#if defined(__CYGWIN__) || defined(_WIN32) -#define SUFFIX ".exe" -#define SUFFIXW L".exe" -#else -#define SUFFIX "" -#define SUFFIXW L"" -#endif - static void dummy_handler(OPT_OP op, optval_t val); -static void create_executable(const char file[]); static int dquotes_allowed_in_paths(void); -static int not_windows(void); static line_stats_t stats; static char *saved_cwd; @@ -88,8 +79,7 @@ { restore_cwd(saved_cwd); - free(cfg.slow_fs_list); - cfg.slow_fs_list = NULL; + update_string(&cfg.slow_fs_list, NULL); free(stats.line); reset_cmds(); @@ -140,25 +130,6 @@ free(buf); } -TEST(test_set_completion) -{ - vle_compl_reset(); - assert_success(line_completion(&stats)); - assert_wstring_equal(L"set all", stats.line); -} - -TEST(no_sdquoted_completion_does_nothing) -{ - free(stats.line); - stats.line = wcsdup(L"command '"); - stats.len = wcslen(stats.line); - stats.index = stats.len; - - vle_compl_reset(); - assert_success(line_completion(&stats)); - assert_wstring_equal(L"command '", stats.line); -} - static void prepare_for_line_completion(const wchar_t str[]) { @@ -171,10 +142,22 @@ vle_compl_reset(); } -TEST(spaces_escaping_leading) +TEST(test_set_completion) { - char *mb; + prepare_for_line_completion(L"set "); + assert_success(line_completion(&stats)); + assert_wstring_equal(L"set all", stats.line); +} + +TEST(no_sdquoted_completion_does_nothing) +{ + prepare_for_line_completion(L"command '"); + assert_success(line_completion(&stats)); + assert_wstring_equal(L"command '", stats.line); +} +TEST(spaces_escaping_leading) +{ make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "spaces-in-names", saved_cwd); assert_success(chdir(curr_view->curr_dir)); @@ -182,39 +165,31 @@ prepare_for_line_completion(L"touch \\ "); assert_success(line_completion(&stats)); - mb = to_multibyte(stats.line); - assert_string_equal("touch \\ begins-with-space", mb); - free(mb); + assert_wstring_equal(L"touch \\ begins-with-space", stats.line); } TEST(spaces_escaping_everywhere) { - char *mb; - assert_success(chdir("../spaces-in-names")); prepare_for_line_completion(L"touch \\ s"); assert_success(line_completion(&stats)); - mb = to_multibyte(stats.line); /* Whether trailing space is there depends on file system and OS. */ if(access("\\ spaces\\ everywhere\\ ", F_OK) == 0) { - assert_string_equal("touch \\ spaces\\ everywhere\\ ", mb); + assert_wstring_equal(L"touch \\ spaces\\ everywhere\\ ", stats.line); } /* Only one condition is true, but don't use else to make one of asserts fail * if there are two files somehow. */ if(access("\\ spaces\\ everywhere", F_OK) == 0) { - assert_string_equal("touch \\ spaces\\ everywhere", mb); + assert_wstring_equal(L"touch \\ spaces\\ everywhere", stats.line); } - free(mb); } TEST(spaces_escaping_trailing) { - char *mb; - make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "spaces-in-names", saved_cwd); assert_success(chdir(curr_view->curr_dir)); @@ -222,25 +197,21 @@ prepare_for_line_completion(L"touch e"); assert_success(line_completion(&stats)); - mb = to_multibyte(stats.line); /* Whether trailing space is there depends on file system and OS. */ if(access("ends-with-space\\ ", F_OK) == 0) { - assert_string_equal("touch ends-with-space\\ ", mb); + assert_wstring_equal(L"touch ends-with-space\\ ", stats.line); } /* Only one condition is true, but don't use else to make one of asserts fail * if there are too files somehow. */ if(access("ends-with-space", F_OK) == 0) { - assert_string_equal("touch ends-with-space", mb); + assert_wstring_equal(L"touch ends-with-space", stats.line); } - free(mb); } TEST(spaces_escaping_middle) { - char *mb; - make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "spaces-in-names", saved_cwd); assert_success(chdir(curr_view->curr_dir)); @@ -248,9 +219,7 @@ prepare_for_line_completion(L"touch s"); assert_success(line_completion(&stats)); - mb = to_multibyte(stats.line); - assert_string_equal("touch spaces\\ in\\ the\\ middle", mb); - free(mb); + assert_wstring_equal(L"touch spaces\\ in\\ the\\ middle", stats.line); } TEST(squoted_completion) @@ -364,6 +333,17 @@ assert_wstring_equal(L"help vifm-!!", stats.line); } +TEST(root_is_completed) +{ + make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), + TEST_DATA_PATH, "", saved_cwd); + assert_success(chdir(curr_view->curr_dir)); + + prepare_for_line_completion(L"cd /"); + assert_success(line_completion(&stats)); + assert_true(wcscmp(L"cd /", stats.line) != 0); +} + TEST(dirs_are_completed_with_trailing_slash) { char *match; @@ -477,37 +457,60 @@ vle_abbr_reset(); } -TEST(bang_abs_path_completion) +TEST(bang_exec_completion) { -#if defined(_WIN32) && !defined(_WIN64) -#define WPRINTF_MBSTR L"S" -#else -#define WPRINTF_MBSTR L"s" -#endif + char *const original_path_env = strdup(env_get("PATH")); + + restore_cwd(saved_cwd); + assert_success(chdir(SANDBOX_PATH)); + saved_cwd = save_cwd(); + + env_set("PATH", saved_cwd); + update_path_env(1); + create_executable("exec-for-completion" EXE_SUFFIX); + + prepare_for_line_completion(L"!exec-for-com"); + assert_success(line_completion(&stats)); + assert_wstring_equal(L"!exec-for-completion" EXE_SUFFIXW, stats.line); + + assert_success(unlink("exec-for-completion" EXE_SUFFIX)); + + env_set("PATH", original_path_env); + update_path_env(1); + free(original_path_env); +} + +TEST(bang_abs_path_completion) +{ + wchar_t input[PATH_MAX]; wchar_t cmd[PATH_MAX]; char cwd[PATH_MAX]; + wchar_t *wcwd; restore_cwd(saved_cwd); saved_cwd = save_cwd(); assert_success(chdir(SANDBOX_PATH)); assert_true(get_cwd(cwd, sizeof(cwd)) == cwd); + wcwd = to_wide(cwd); - create_executable("exec-for-completion" SUFFIX); + create_executable("exec-for-completion" EXE_SUFFIX); + vifm_swprintf(input, ARRAY_LEN(input), + L"!%" WPRINTF_WSTR L"/exec-for-compl", wcwd); vifm_swprintf(cmd, ARRAY_LEN(cmd), - L"!%" WPRINTF_MBSTR L"/exec-for-completion" SUFFIXW, cwd); + L"!%" WPRINTF_WSTR L"/exec-for-completion" EXE_SUFFIXW, wcwd); - prepare_for_line_completion(cmd); + prepare_for_line_completion(input); assert_success(line_completion(&stats)); assert_wstring_equal(cmd, stats.line); assert_int_equal(2, vle_compl_get_count()); - assert_success(unlink("exec-for-completion" SUFFIX)); + assert_success(unlink("exec-for-completion" EXE_SUFFIX)); -#undef WPRINTF_MBSTR + free(wcwd); } TEST(tilde_is_completed_after_emark) @@ -550,13 +553,13 @@ make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), SANDBOX_PATH, "", saved_cwd); assert_success(chdir(curr_view->curr_dir)); - create_executable("exec-for-completion" SUFFIX); + create_executable("exec-for-completion" EXE_SUFFIX); prepare_for_line_completion(L"bmark! exec"); assert_success(line_completion(&stats)); - assert_wstring_equal(L"bmark! exec-for-completion" SUFFIX, stats.line); + assert_wstring_equal(L"bmark! exec-for-completion" EXE_SUFFIX, stats.line); - assert_success(unlink("exec-for-completion" SUFFIX)); + assert_success(unlink("exec-for-completion" EXE_SUFFIX)); } TEST(delbmark_tags_are_completed) @@ -618,6 +621,10 @@ TEST(grep_completion) { + prepare_for_line_completion(L"grep -"); + assert_success(line_completion(&stats)); + assert_wstring_equal(L"grep -", stats.line); + prepare_for_line_completion(L"grep ."); assert_success(line_completion(&stats)); assert_wstring_equal(L"grep .", stats.line); @@ -628,6 +635,8 @@ make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "", saved_cwd); + assert_success(chdir(curr_view->curr_dir)); + prepare_for_line_completion(L"grep -o "); assert_success(line_completion(&stats)); assert_wstring_equal(L"grep -o existing-files/", stats.line); @@ -635,6 +644,15 @@ TEST(find_completion) { + prepare_for_line_completion(L"find -"); + assert_success(line_completion(&stats)); +#ifdef _WIN32 + /* Windows escaping code doesn't prepend "./". */ + assert_wstring_equal(L"find -", stats.line); +#else + assert_wstring_equal(L"find ./-", stats.line); +#endif + prepare_for_line_completion(L"find .."); assert_success(line_completion(&stats)); assert_wstring_equal(L"find ../", stats.line); @@ -645,6 +663,8 @@ make_abs_path(curr_view->curr_dir, sizeof(curr_view->curr_dir), TEST_DATA_PATH, "", saved_cwd); + assert_success(chdir(curr_view->curr_dir)); + prepare_for_line_completion(L"find "); assert_success(line_completion(&stats)); assert_wstring_equal(L"find existing-files/", stats.line); @@ -772,15 +792,6 @@ assert_success(remove(SANDBOX_PATH "/dir-link")); } -static void -create_executable(const char file[]) -{ - create_file(file); - assert_success(access(file, F_OK)); - chmod(file, 0755); - assert_success(access(file, X_OK)); -} - static int dquotes_allowed_in_paths(void) { @@ -792,15 +803,5 @@ return 0; } -static int -not_windows(void) -{ -#ifdef _WIN32 - return 0; -#else - return 1; -#endif -} - /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/misc/commands.c new/vifm-0.8.2/tests/misc/commands.c --- old/vifm-0.8.2-beta/tests/misc/commands.c 2016-07-02 10:25:57.000000000 +0200 +++ new/vifm-0.8.2/tests/misc/commands.c 2016-07-16 11:27:33.000000000 +0200 @@ -32,7 +32,6 @@ static void check_filetype(void); static int prog_exists(const char name[]); static int has_mime_type_detection(void); -static int not_windows(void); static const cmd_add_t commands[] = { { .name = "builtin", .abbr = NULL, .id = -1, .descr = "descr", @@ -249,6 +248,17 @@ assert_success(unlink("out")); } +TEST(cd_in_root_works) +{ + assert_success(chdir(test_data)); + + strcpy(lwin.curr_dir, test_data); + + assert_false(is_root_dir(lwin.curr_dir)); + assert_success(exec_commands("cd /", &lwin, CIT_COMMAND)); + assert_true(is_root_dir(lwin.curr_dir)); +} + TEST(double_cd_uses_same_base_for_rel_paths) { char path[PATH_MAX]; @@ -473,21 +483,30 @@ ft_reset(0); } -TEST(pattern_anding_and_orring, IF(has_mime_type_detection)) +TEST(pattern_anding_and_orring_failures) { - assoc_records_t ft; - - ft_init(&prog_exists); - + /* No matching is performed, so we can use application/octet-stream. */ assert_failure(exec_commands("filetype /*/," "<application/octet-stream>{binary-data} app", &lwin, CIT_COMMAND)); assert_failure(exec_commands("fileviewer /*/," "<application/octet-stream>{binary-data} viewer", &lwin, CIT_COMMAND)); +} - assert_success(exec_commands("filetype {two-lines}<text/plain>," - "<application/octet-stream>{binary-data} app", &lwin, CIT_COMMAND)); - assert_success(exec_commands("fileviewer {two-lines}<text/plain>," - "<application/octet-stream>{binary-data} viewer", &lwin, CIT_COMMAND)); +TEST(pattern_anding_and_orring, IF(has_mime_type_detection)) +{ + char cmd[1024]; + assoc_records_t ft; + + ft_init(&prog_exists); + + snprintf(cmd, sizeof(cmd), + "filetype {two-lines}<text/plain>,<%s>{binary-data} app", + get_mimetype(TEST_DATA_PATH "/read/binary-data")); + assert_success(exec_commands(cmd, &lwin, CIT_COMMAND)); + snprintf(cmd, sizeof(cmd), + "fileviewer {two-lines}<text/plain>,<%s>{binary-data} viewer", + get_mimetype(TEST_DATA_PATH "/read/binary-data")); + assert_success(exec_commands(cmd, &lwin, CIT_COMMAND)); ft = ft_get_all_programs(TEST_DATA_PATH "/read/two-lines"); assert_int_equal(1, ft.count); @@ -651,15 +670,5 @@ return get_mimetype(TEST_DATA_PATH "/read/dos-line-endings") != NULL; } -static int -not_windows(void) -{ -#ifdef _WIN32 - return 0; -#else - return 1; -#endif -} - /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/misc/commands_sync.c new/vifm-0.8.2/tests/misc/commands_sync.c --- old/vifm-0.8.2-beta/tests/misc/commands_sync.c 2016-07-02 10:25:57.000000000 +0200 +++ new/vifm-0.8.2/tests/misc/commands_sync.c 2016-07-16 11:27:33.000000000 +0200 @@ -14,9 +14,8 @@ #include "../../src/cmd_core.h" #include "../../src/filelist.h" #include "../../src/filtering.h" -#include "utils.h" -static int not_windows(void); +#include "utils.h" SETUP() { @@ -118,15 +117,5 @@ assert_success(remove(SANDBOX_PATH "/dir-link")); } -static int -not_windows(void) -{ -#ifdef _WIN32 - return 0; -#else - return 1; -#endif -} - /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/misc/flist_custom.c new/vifm-0.8.2/tests/misc/flist_custom.c --- old/vifm-0.8.2-beta/tests/misc/flist_custom.c 2016-07-02 10:25:57.000000000 +0200 +++ new/vifm-0.8.2/tests/misc/flist_custom.c 2016-07-16 11:27:33.000000000 +0200 @@ -33,7 +33,6 @@ size_t offset, AlignType align, const char full_column[]); static void setup_custom_view(FileView *view, int very); static int filenames_can_include_newline(void); -static int not_windows(void); static char test_data[PATH_MAX]; static const size_t MAX_WIDTH = 20; @@ -481,7 +480,7 @@ columns_clear_column_descs(); } -TEST(files_with, IF(filenames_can_include_newline)) +TEST(files_with_newline_in_names, IF(filenames_can_include_newline)) { FILE *const f = fopen(SANDBOX_PATH "/list", "w"); fprintf(f, "%s%c", SANDBOX_PATH "/a\nb", '\0'); @@ -493,7 +492,8 @@ stats_update_shell_type(cfg.shell); create_file("a\nb"); - output_to_custom_flist(&lwin, "cat list", 0); + assert_non_null(get_cwd(lwin.curr_dir, sizeof(lwin.curr_dir))); + assert_success(output_to_custom_flist(&lwin, "cat list", 0)); assert_success(unlink("a\nb")); assert_success(unlink("list")); @@ -599,15 +599,5 @@ return 0; } -static int -not_windows(void) -{ -#ifdef _WIN32 - return 0; -#else - return 1; -#endif -} - /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/misc/menus.c new/vifm-0.8.2/tests/misc/menus.c --- old/vifm-0.8.2-beta/tests/misc/menus.c 2016-06-28 13:28:06.000000000 +0200 +++ new/vifm-0.8.2/tests/misc/menus.c 2016-07-06 22:02:38.000000000 +0200 @@ -10,7 +10,7 @@ #include "../../src/utils/fs.h" #include "../../src/utils/string_array.h" -static int not_windows(void); +#include "utils.h" static menu_info m; @@ -200,15 +200,5 @@ assert_int_equal(2, m.pos); } -static int -not_windows(void) -{ -#ifdef _WIN32 - return 0; -#else - return 1; -#endif -} - /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/misc/utils.c new/vifm-0.8.2/tests/misc/utils.c --- old/vifm-0.8.2-beta/tests/misc/utils.c 2016-07-02 10:25:57.000000000 +0200 +++ new/vifm-0.8.2/tests/misc/utils.c 2016-07-16 11:27:33.000000000 +0200 @@ -1,5 +1,8 @@ #include "utils.h" +#include <sys/stat.h> /* chmod() */ +#include <unistd.h> /* access() */ + #include <stddef.h> /* NULL */ #include <stdio.h> /* fclose() fopen() */ #include <string.h> /* memset() strcpy() */ @@ -127,6 +130,15 @@ } void +create_executable(const char path[]) +{ + create_file(path); + assert_success(access(path, F_OK)); + chmod(path, 0755); + assert_success(access(path, X_OK)); +} + +void make_abs_path(char buf[], size_t buf_len, const char base[], const char sub[], const char cwd[]) { @@ -140,5 +152,15 @@ } } +int +not_windows(void) +{ +#ifdef _WIN32 + return 0; +#else + return 1; +#endif +} + /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 filetype=c : */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/misc/utils.h new/vifm-0.8.2/tests/misc/utils.h --- old/vifm-0.8.2-beta/tests/misc/utils.h 2016-07-02 10:27:11.000000000 +0200 +++ new/vifm-0.8.2/tests/misc/utils.h 2016-07-10 11:49:20.000000000 +0200 @@ -3,6 +3,15 @@ #include "../../src/ui/ui.h" +/* Executable suffixes. */ +#if defined(__CYGWIN__) || defined(_WIN32) +#define EXE_SUFFIX ".exe" +#define EXE_SUFFIXW L".exe" +#else +#define EXE_SUFFIX "" +#define EXE_SUFFIXW L"" +#endif + /* Prepares option handler for use in tests. */ void opt_handlers_setup(void); @@ -18,10 +27,17 @@ /* Creates file at the path. */ void create_file(const char path[]); +/* Creates executable file at the path. */ +void create_executable(const char path[]); + /* Either puts base/sub or cwd/base/sub into the buf. */ void make_abs_path(char buf[], size_t buf_len, const char base[], const char sub[], const char cwd[]); +/* Whether running on non-Windowsla. Returns non-zero if so, otherwise zero is + * returned. */ +int not_windows(void); + #endif /* VIFM_TESTS__UTILS_H__ */ /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/utils/canonical.c new/vifm-0.8.2/tests/utils/canonical.c --- old/vifm-0.8.2-beta/tests/utils/canonical.c 2016-06-20 14:37:05.000000000 +0200 +++ new/vifm-0.8.2/tests/utils/canonical.c 2016-07-06 22:02:38.000000000 +0200 @@ -9,6 +9,17 @@ #define ABS_PREFIX "c:" #endif +TEST(basic) +{ + char buf[PATH_MAX]; + + canonicalize_path(ABS_PREFIX "/", buf, sizeof(buf)); + assert_string_equal(ABS_PREFIX "/", buf); + + to_canonic_path(ABS_PREFIX "/", "fake-base", buf, sizeof(buf)); + assert_string_equal(ABS_PREFIX "/", buf); +} + TEST(root_updir) { char buf[PATH_MAX]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/vifm-0.8.2-beta/tests/utils/process_cmd_output.c new/vifm-0.8.2/tests/utils/process_cmd_output.c --- old/vifm-0.8.2-beta/tests/utils/process_cmd_output.c 1970-01-01 01:00:00.000000000 +0100 +++ new/vifm-0.8.2/tests/utils/process_cmd_output.c 2016-07-16 13:38:49.000000000 +0200 @@ -0,0 +1,63 @@ +#include <stic.h> + +#include <unistd.h> /* chdir() unlink() */ + +#include <stdio.h> /* fclose() fopen() fprintf() */ + +#include "../../src/cfg/config.h" +#include "../../src/utils/fs.h" +#include "../../src/utils/str.h" +#include "../../src/utils/utils.h" +#include "../../src/cmd_completion.h" + +static void line_handler(const char line[], void *arg); +static int cat_is_available(void); + +static int nlines; + +TEST(check_null_separation, IF(cat_is_available)) +{ + char *saved_cwd; + + FILE *const f = fopen(SANDBOX_PATH "/list", "w"); + fprintf(f, "%s%c", SANDBOX_PATH "/a\nb", '\0'); + fclose(f); + + saved_cwd = save_cwd(); + + assert_success(chdir(SANDBOX_PATH)); + +#ifndef _WIN32 + replace_string(&cfg.shell, "/bin/sh"); +#else + replace_string(&cfg.shell, "cmd"); +#endif + stats_update_shell_type(cfg.shell); + + nlines = 0; + assert_success(process_cmd_output("tests", "cat list", 1, &line_handler, + NULL)); + assert_int_equal(1, nlines); + + stats_update_shell_type("/bin/sh"); + update_string(&cfg.shell, NULL); + + assert_success(unlink("list")); + + restore_cwd(saved_cwd); +} + +static void +line_handler(const char line[], void *arg) +{ + ++nlines; +} + +static int +cat_is_available(void) +{ + return external_command_exists("cat"); +} + +/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ +/* vim: set cinoptions+=t0 filetype=c : */