To: vim_dev@googlegroups.com Subject: Patch 8.1.0314 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0314 (after 8.1.0313) Problem: Build failure without the +eval feature. (Brenton Horne) Solution: Add #ifdef. Also add the "dirty" item. Files: src/memline.c, runtime/doc/eval.txt, src/testdir/test_swap.vim *** ../vim-8.1.0313/src/memline.c 2018-08-21 20:28:49.888006612 +0200 --- src/memline.c 2018-08-21 21:07:08.927388911 +0200 *************** *** 2041,2046 **** --- 2041,2047 ---- static int process_still_running; #endif + #if defined(FEAT_EVAL) || defined(PROTO) /* * Return information found in swapfile "fname" in dictionary "d". * This is used by the swapinfo() function. *************** *** 2055,2065 **** { if (read_eintr(fd, &b0, sizeof(b0)) == sizeof(b0)) { ! if (b0_magic_wrong(&b0)) ! { dict_add_string(d, "error", ! vim_strsave((char_u *)"magic number mismatch")); ! } else { /* we have swap information */ --- 2056,2067 ---- { if (read_eintr(fd, &b0, sizeof(b0)) == sizeof(b0)) { ! if (ml_check_b0_id(&b0) == FAIL) dict_add_string(d, "error", ! vim_strsave((char_u *)"Not a swap file")); ! else if (b0_magic_wrong(&b0)) ! dict_add_string(d, "error", ! vim_strsave((char_u *)"Magic number mismatch")); else { /* we have swap information */ *************** *** 2070,2078 **** dict_add_number(d, "pid", char_to_long(b0.b0_pid)); dict_add_number(d, "mtime", char_to_long(b0.b0_mtime)); ! #ifdef CHECK_INODE dict_add_number(d, "inode", char_to_long(b0.b0_ino)); ! #endif } } else --- 2072,2081 ---- dict_add_number(d, "pid", char_to_long(b0.b0_pid)); dict_add_number(d, "mtime", char_to_long(b0.b0_mtime)); ! dict_add_number(d, "dirty", b0.b0_dirty ? 1 : 0); ! # ifdef CHECK_INODE dict_add_number(d, "inode", char_to_long(b0.b0_ino)); ! # endif } } else *************** *** 2083,2088 **** --- 2086,2092 ---- else dict_add_string(d, "error", vim_strsave((char_u *)"Cannot open file")); } + #endif /* * Give information about an existing swap file. *** ../vim-8.1.0313/runtime/doc/eval.txt 2018-08-21 20:28:49.884006638 +0200 --- runtime/doc/eval.txt 2018-08-21 21:06:33.431590332 +0200 *************** *** 8011,8020 **** file mtime last modification time in seconds inode Optional: INODE number of the file In case of failure an "error" item is added with the reason: Cannot open file: file not found or in accessible Cannot read file: cannot read first block ! magic number mismatch: info in first block is invalid synID({lnum}, {col}, {trans}) *synID()* The result is a Number, which is the syntax ID at the position --- 8020,8031 ---- file mtime last modification time in seconds inode Optional: INODE number of the file + dirty 1 if file was modified, 0 if not In case of failure an "error" item is added with the reason: Cannot open file: file not found or in accessible Cannot read file: cannot read first block ! Not a swap file: does not contain correct block ID ! Magic number mismatch: Info in first block is invalid synID({lnum}, {col}, {trans}) *synID()* The result is a Number, which is the syntax ID at the position *** ../vim-8.1.0313/src/testdir/test_swap.vim 2018-08-21 20:28:49.892006588 +0200 --- src/testdir/test_swap.vim 2018-08-21 21:07:26.571288544 +0200 *************** *** 109,114 **** --- 109,115 ---- call assert_match('\w', info.user) call assert_equal(hostname(), info.host) call assert_match('Xswapinfo', info.fname) + call assert_match(0, info.dirty) call assert_equal(getpid(), info.pid) call assert_match('^\d*$', info.mtime) if has_key(info, 'inode') *************** *** 128,133 **** call writefile([repeat('x', 10000)], 'Xnotaswapfile') let info = swapinfo('Xnotaswapfile') ! call assert_equal('magic number mismatch', info.error) call delete('Xnotaswapfile') endfunc --- 129,134 ---- call writefile([repeat('x', 10000)], 'Xnotaswapfile') let info = swapinfo('Xnotaswapfile') ! call assert_equal('Not a swap file', info.error) call delete('Xnotaswapfile') endfunc *** ../vim-8.1.0313/src/version.c 2018-08-21 20:28:49.892006588 +0200 --- src/version.c 2018-08-21 21:08:05.951063970 +0200 *************** *** 796,797 **** --- 796,799 ---- { /* Add new patch number below this line */ + /**/ + 314, /**/ -- DENNIS: You can't expect to wield supreme executive power just 'cause some watery tart threw a sword at you! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///