Subversion Repositories DevTools

Rev

Rev 227 | Rev 303 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 227 Rev 255
Line 343... Line 343...
343
#if (OS_TYPE != OS_UNIX)
343
#if (OS_TYPE != OS_UNIX)
344
extern char 		*_APgmName;
344
extern char 		*_APgmName;
345
extern char		*_ACmdLine;
345
extern char		*_ACmdLine;
346
#endif
346
#endif
347
 
347
 
-
 
348
/*
-
 
349
**  Debug level
-
 
350
*/
-
 
351
int debug_level = 0;
348
 
352
 
349
/*
353
/*
350
 * The main program starts here
354
 * The main program starts here
351
 */
355
 */
352
#if defined(WIN32)
356
#if defined(WIN32)
Line 621... Line 625...
621
/*
625
/*
622
 * If the x or r flag was set on the command line, set it now after the
626
 * If the x or r flag was set on the command line, set it now after the
623
 * profiles have been executed.
627
 * profiles have been executed.
624
 */
628
 */
625
 
629
 
626
    if (GetVariableAsString("SHDEBUGEXEC", FALSE) != null)
630
    if ( debug_level & DEBUG_EXEC_ALL )
627
    {
631
    {
628
	FL_SET (FLAG_DEBUG_EXECUTE);
632
    	FL_SET (FLAG_DEBUG_EXECUTE);
629
     	FL_CLEAR (FLAG_WARNING);
633
     	FL_CLEAR (FLAG_WARNING);
630
    }
634
    }
631
 
-
 
632
    if (OptionsXflag)
635
    if (OptionsXflag)
633
    {
636
    {
634
        FL_SET (FLAG_PRINT_EXECUTE);
637
        FL_SET (FLAG_PRINT_EXECUTE);
635
    }
638
    }
636
 
639
 
Line 2597... Line 2600...
2597
#endif
2600
#endif
2598
	    if (AssignVariableFromString (*ap, (int *)NULL))
2601
	    if (AssignVariableFromString (*ap, (int *)NULL))
2599
		SetVariableStatus (*ap, STATUS_EXPORT);
2602
		SetVariableStatus (*ap, STATUS_EXPORT);
2600
	}
2603
	}
2601
 
2604
 
-
 
2605
    /*
-
 
2606
    **  Can not access varibales from the environment
-
 
2607
    **  Set up debug level
-
 
2608
    */
-
 
2609
    debug_level = GetVariableAsNumeric ("SHDEBUGEXEC" );
-
 
2610
 
2602
#if (OS_TYPE == OS_NT)
2611
#if (OS_TYPE == OS_NT)
2603
        if (pathcnt)
2612
        if (pathcnt)
2604
        {                                       /* import */
2613
        {                                       /* import */
2605
            const char   *p;                    /* path and alternative */
2614
            const char   *p;                    /* path and alternative */
2606
 
-
 
-
 
2615
            int dbg = (debug_level & DEBUG_MULTIPATH);
2607
            p = paths[0];
2616
            p = paths[0];
2608
            if (pathcnt > 1)
2617
            if (pathcnt > 1)
2609
            {
2618
            {
2610
                int      dbg, err, i;
2619
                int      err, i;
2611
                int      pl, al;
2620
                int      pl, al;
2612
 
2621
 
2613
                dbg = GetVariableAsString( "SHDEBUGEXEC", 0 ) != null ? 1 : 0;
-
 
2614
 
-
 
2615
                pl = -1;
2622
                pl = -1;
2616
                for (i=0; i<pathcnt; i++) {     /* select greater */
2623
                for (i=0; i<pathcnt; i++) {     /* select greater */
2617
                    if ((al = strlen(paths[i])) > pl) {
2624
                    if ((al = strlen(paths[i])) > pl) {
2618
                         p = paths[i];
2625
                         p = paths[i];
2619
                         pl = al;
2626
                         pl = al;
2620
                    }
2627
                    }
2621
                }
2628
                }
2622
 
2629
 
2623
                if (dbg) {
2630
                if (dbg) {
2624
                    fprintf ( stderr,
-
 
2625
"Encountered %d path definitions ...\n", pathcnt );
2631
                    fprintf ( stderr, "Encountered %d path definitions ...\n", pathcnt );
2626
                }
2632
                }
2627
 
2633
 
2628
                for (err=0, i=0; i<pathcnt; i++) {
2634
                for (err=0, i=0; i<pathcnt; i++) {
2629
                                                /* diff alternatives */
2635
                                                /* diff alternatives */
2630
                    if (dbg) {
2636
                    if (dbg) {
Line 2644... Line 2650...
2644
                                fprintf ( stderr, " .. different!\n" );
2650
                                fprintf ( stderr, " .. different!\n" );
2645
                            }
2651
                            }
2646
 
2652
 
2647
	                    if (!FL_TEST (FLAG_WARNING)) {
2653
	                    if (!FL_TEST (FLAG_WARNING)) {
2648
                                if (err++ == 0)
2654
                                if (err++ == 0)
2649
                                    PrintWarningMessage (
2655
                                    PrintWarningMessage ( "sh: %d path definitions encountered.", pathcnt );
2650
"sh: %d path definitions encountered.", pathcnt );
-
 
2651
 
-
 
2652
                                PrintWarningMessage (
-
 
2653
"sh: ignoring differing alternative '%.4s'\n %s", paths[i], paths[i] );
2656
                                PrintWarningMessage ( "sh: ignoring differing alternative '%.4s'\n %s", paths[i], paths[i] );
2654
                            }
2657
                            }
2655
 
2658
 
2656
                        } else if (ret == 0) {
2659
                        } else if (ret == 0) {
2657
                            if (dbg) {          /* .. same value */
2660
                            if (dbg) {          /* .. same value */
2658
                                fprintf ( stderr, " .. same.\n" );
2661
                                fprintf ( stderr, " .. same.\n" );
Line 2668... Line 2671...
2668
 
2671
 
2669
                if (err) {
2672
                if (err) {
2670
                    PrintWarningMessage ( "sh: using '%.4s'\n %s.", p, p );
2673
                    PrintWarningMessage ( "sh: using '%.4s'\n %s.", p, p );
2671
                }
2674
                }
2672
            }
2675
            }
-
 
2676
            else if ( dbg )
-
 
2677
            {
-
 
2678
                    fprintf ( stderr, "Only one PATH definition seen\n", pathcnt );
-
 
2679
            }
2673
 
2680
 
2674
            SetVariableFromString (PathLiteral, (char *)(p + PATHOFF));
2681
            SetVariableFromString (PathLiteral, (char *)(p + PATHOFF));
2675
            SetVariableStatus (PathLiteral, STATUS_EXPORT);
2682
            SetVariableStatus (PathLiteral, STATUS_EXPORT);
2676
        }
2683
        }
2677
 
2684