To: vim-dev@vim.org Subject: Patch 6.1.234 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.234 (depends on 6.1.217) Problem: Get a warning for using a negative value for st_dev. Solution: Don't assign a negative value to st_dev. Files: src/ex_cmds2.c *** ../vim61.233/src/ex_cmds2.c Sun Oct 20 12:46:37 2002 --- src/ex_cmds2.c Sun Oct 20 22:56:08 2002 *************** *** 1897,1902 **** --- 1897,1903 ---- int save_debug_break_level = debug_break_level; # ifdef UNIX struct stat st; + int stat_ok; # endif #endif #ifdef STARTUPTIME *************** *** 2029,2036 **** */ save_current_SID = current_SID; # ifdef UNIX ! if (mch_stat((char *)fname_exp, &st) < 0) ! st.st_dev = -1; # endif for (current_SID = script_names.ga_len; current_SID > 0; --current_SID) if (SCRIPT_NAME(current_SID) != NULL --- 2030,2036 ---- */ save_current_SID = current_SID; # ifdef UNIX ! stat_ok = (mch_stat((char *)fname_exp, &st) >= 0); # endif for (current_SID = script_names.ga_len; current_SID > 0; --current_SID) if (SCRIPT_NAME(current_SID) != NULL *************** *** 2038,2044 **** # ifdef UNIX /* compare dev/ino when possible, it catches symbolic * links */ ! (st.st_dev != -1 && SCRIPT_DEV(current_SID) != -1) ? (SCRIPT_DEV(current_SID) == st.st_dev && SCRIPT_INO(current_SID) == st.st_ino) : # endif --- 2038,2044 ---- # ifdef UNIX /* compare dev/ino when possible, it catches symbolic * links */ ! (stat_ok && SCRIPT_DEV(current_SID) != -1) ? (SCRIPT_DEV(current_SID) == st.st_dev && SCRIPT_INO(current_SID) == st.st_ino) : # endif *************** *** 2058,2066 **** } SCRIPT_NAME(current_SID) = fname_exp; # ifdef UNIX ! SCRIPT_DEV(current_SID) = st.st_dev; ! if (st.st_dev != -1) SCRIPT_INO(current_SID) = st.st_ino; # endif fname_exp = NULL; } --- 2058,2070 ---- } SCRIPT_NAME(current_SID) = fname_exp; # ifdef UNIX ! if (stat_ok) ! { ! SCRIPT_DEV(current_SID) = st.st_dev; SCRIPT_INO(current_SID) = st.st_ino; + } + else + SCRIPT_DEV(current_SID) = -1; # endif fname_exp = NULL; } *** ../vim61.233/src/version.c Sun Oct 27 14:30:34 2002 --- src/version.c Sun Oct 27 14:31:36 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 234, /**/ -- DEAD PERSON: I don't want to go in the cart! CUSTOMER: Oh, don't be such a baby. MORTICIAN: I can't take him... DEAD PERSON: I feel fine! CUSTOMER: Oh, do us a favor... MORTICIAN: I can't. The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///