comparison src/main.c @ 819:23f82b5d2814 v7.0c10

updated for version 7.0c10
author vimboss
date Wed, 05 Apr 2006 20:41:53 +0000
parents 4a79d6d376f0
children 8bebcabccc2c
comparison
equal deleted inserted replaced
818:1f929f3ca806 819:23f82b5d2814
2166 #endif 2166 #endif
2167 ); 2167 );
2168 2168
2169 #if defined(FEAT_MBYTE) && defined(WIN32) 2169 #if defined(FEAT_MBYTE) && defined(WIN32)
2170 { 2170 {
2171 extern void used_file_arg(char *, int, int);
2172
2173 /* Remember this argument has been added to the argument list. 2171 /* Remember this argument has been added to the argument list.
2174 * Needed when 'encoding' is changed. */ 2172 * Needed when 'encoding' is changed. */
2175 used_file_arg(argv[0], parmp->literal, parmp->full_path); 2173 used_file_arg(argv[0], parmp->literal, parmp->full_path,
2174 parmp->diff_mode);
2176 } 2175 }
2177 #endif 2176 #endif
2178 } 2177 }
2179 2178
2180 /* 2179 /*
2565 * For "evim" source evim.vim first of all, so that the user can overrule 2564 * For "evim" source evim.vim first of all, so that the user can overrule
2566 * any things he doesn't like. 2565 * any things he doesn't like.
2567 */ 2566 */
2568 if (parmp->evim_mode) 2567 if (parmp->evim_mode)
2569 { 2568 {
2570 (void)do_source((char_u *)EVIM_FILE, FALSE, FALSE); 2569 (void)do_source((char_u *)EVIM_FILE, FALSE, DOSO_NONE);
2571 TIME_MSG("source evim file"); 2570 TIME_MSG("source evim file");
2572 } 2571 }
2573 2572
2574 /* 2573 /*
2575 * If -u argument given, use only the initializations from that file and 2574 * If -u argument given, use only the initializations from that file and
2587 if (parmp->use_vimrc[2] == 'N') 2586 if (parmp->use_vimrc[2] == 'N')
2588 p_lpl = FALSE; /* don't load plugins either */ 2587 p_lpl = FALSE; /* don't load plugins either */
2589 } 2588 }
2590 else 2589 else
2591 { 2590 {
2592 if (do_source(parmp->use_vimrc, FALSE, FALSE) != OK) 2591 if (do_source(parmp->use_vimrc, FALSE, DOSO_NONE) != OK)
2593 EMSG2(_("E282: Cannot read from \"%s\""), parmp->use_vimrc); 2592 EMSG2(_("E282: Cannot read from \"%s\""), parmp->use_vimrc);
2594 } 2593 }
2595 } 2594 }
2596 else if (!silent_mode) 2595 else if (!silent_mode)
2597 { 2596 {
2605 2604
2606 /* 2605 /*
2607 * Get system wide defaults, if the file name is defined. 2606 * Get system wide defaults, if the file name is defined.
2608 */ 2607 */
2609 #ifdef SYS_VIMRC_FILE 2608 #ifdef SYS_VIMRC_FILE
2610 (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, FALSE); 2609 (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE);
2611 #endif 2610 #endif
2612 #ifdef MACOS_X 2611 #ifdef MACOS_X
2613 (void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE, FALSE); 2612 (void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE, DOSO_NONE);
2614 #endif 2613 #endif
2615 2614
2616 /* 2615 /*
2617 * Try to read initialization commands from the following places: 2616 * Try to read initialization commands from the following places:
2618 * - environment variable VIMINIT 2617 * - environment variable VIMINIT
2623 * - second user exrc file ($VIM/.exrc for Dos) 2622 * - second user exrc file ($VIM/.exrc for Dos)
2624 * The first that exists is used, the rest is ignored. 2623 * The first that exists is used, the rest is ignored.
2625 */ 2624 */
2626 if (process_env((char_u *)"VIMINIT", TRUE) != OK) 2625 if (process_env((char_u *)"VIMINIT", TRUE) != OK)
2627 { 2626 {
2628 if (do_source((char_u *)USR_VIMRC_FILE, TRUE, TRUE) == FAIL 2627 if (do_source((char_u *)USR_VIMRC_FILE, TRUE, DOSO_VIMRC) == FAIL
2629 #ifdef USR_VIMRC_FILE2 2628 #ifdef USR_VIMRC_FILE2
2630 && do_source((char_u *)USR_VIMRC_FILE2, TRUE, TRUE) == FAIL 2629 && do_source((char_u *)USR_VIMRC_FILE2, TRUE,
2630 DOSO_VIMRC) == FAIL
2631 #endif 2631 #endif
2632 #ifdef USR_VIMRC_FILE3 2632 #ifdef USR_VIMRC_FILE3
2633 && do_source((char_u *)USR_VIMRC_FILE3, TRUE, TRUE) == FAIL 2633 && do_source((char_u *)USR_VIMRC_FILE3, TRUE,
2634 DOSO_VIMRC) == FAIL
2634 #endif 2635 #endif
2635 && process_env((char_u *)"EXINIT", FALSE) == FAIL 2636 && process_env((char_u *)"EXINIT", FALSE) == FAIL
2636 && do_source((char_u *)USR_EXRC_FILE, FALSE, FALSE) == FAIL) 2637 && do_source((char_u *)USR_EXRC_FILE, FALSE, DOSO_NONE) == FAIL)
2637 { 2638 {
2638 #ifdef USR_EXRC_FILE2 2639 #ifdef USR_EXRC_FILE2
2639 (void)do_source((char_u *)USR_EXRC_FILE2, FALSE, FALSE); 2640 (void)do_source((char_u *)USR_EXRC_FILE2, FALSE, DOSO_NONE);
2640 #endif 2641 #endif
2641 } 2642 }
2642 } 2643 }
2643 2644
2644 /* 2645 /*
2672 #ifdef SYS_VIMRC_FILE 2673 #ifdef SYS_VIMRC_FILE
2673 && fullpathcmp((char_u *)SYS_VIMRC_FILE, 2674 && fullpathcmp((char_u *)SYS_VIMRC_FILE,
2674 (char_u *)VIMRC_FILE, FALSE) != FPC_SAME 2675 (char_u *)VIMRC_FILE, FALSE) != FPC_SAME
2675 #endif 2676 #endif
2676 ) 2677 )
2677 i = do_source((char_u *)VIMRC_FILE, TRUE, TRUE); 2678 i = do_source((char_u *)VIMRC_FILE, TRUE, DOSO_VIMRC);
2678 2679
2679 if (i == FAIL) 2680 if (i == FAIL)
2680 { 2681 {
2681 #if defined(UNIX) || defined(VMS) 2682 #if defined(UNIX) || defined(VMS)
2682 /* if ".exrc" is not owned by user set 'secure' mode */ 2683 /* if ".exrc" is not owned by user set 'secure' mode */
2690 #ifdef USR_EXRC_FILE2 2691 #ifdef USR_EXRC_FILE2
2691 && fullpathcmp((char_u *)USR_EXRC_FILE2, 2692 && fullpathcmp((char_u *)USR_EXRC_FILE2,
2692 (char_u *)EXRC_FILE, FALSE) != FPC_SAME 2693 (char_u *)EXRC_FILE, FALSE) != FPC_SAME
2693 #endif 2694 #endif
2694 ) 2695 )
2695 (void)do_source((char_u *)EXRC_FILE, FALSE, FALSE); 2696 (void)do_source((char_u *)EXRC_FILE, FALSE, DOSO_NONE);
2696 } 2697 }
2697 } 2698 }
2698 if (secure == 2) 2699 if (secure == 2)
2699 need_wait_return = TRUE; 2700 need_wait_return = TRUE;
2700 secure = 0; 2701 secure = 0;
2737 #endif 2738 #endif
2738 2739
2739 if ((initstr = mch_getenv(env)) != NULL && *initstr != NUL) 2740 if ((initstr = mch_getenv(env)) != NULL && *initstr != NUL)
2740 { 2741 {
2741 if (is_viminit) 2742 if (is_viminit)
2742 vimrc_found(); 2743 vimrc_found(NULL, NULL);
2743 save_sourcing_name = sourcing_name; 2744 save_sourcing_name = sourcing_name;
2744 save_sourcing_lnum = sourcing_lnum; 2745 save_sourcing_lnum = sourcing_lnum;
2745 sourcing_name = env; 2746 sourcing_name = env;
2746 sourcing_lnum = 0; 2747 sourcing_lnum = 0;
2747 #ifdef FEAT_EVAL 2748 #ifdef FEAT_EVAL