about summary refs log tree commit diff stats
path: root/apps/ex2
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-05-27 00:01:12 -0700
committerKartik Agaram <vc@akkartik.com>2020-05-27 00:01:12 -0700
commit985f7f79bee5481cc1247d1d68b1b2d47f5b500c (patch)
tree8d1ae3feda77a15bf3e46137b8dfc0376b4c3880 /apps/ex2
parent58d866d7a479b21ddbdcf53d08c7dfedc3a9bdf9 (diff)
downloadmu-985f7f79bee5481cc1247d1d68b1b2d47f5b500c.tar.gz
6408
Diffstat (limited to 'apps/ex2')
0 files changed, 0 insertions, 0 deletions
shots/blame/src/LYExtern.c?id=43797ce7b89f70182191e7b41521772c7efa2d25'>^
945e8eb6 ^
57bfc74f ^
55ebd12c ^
945e8eb6 ^









d3f9d547 ^

945e8eb6 ^




d3f9d547 ^
945e8eb6 ^








d3f9d547 ^
945e8eb6 ^
d3f9d547 ^
945e8eb6 ^







d3f9d547 ^
945e8eb6 ^

d3f9d547 ^
945e8eb6 ^









1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
















                                                                        
                    

                         

                     
 
                    
 
                    
                                  









                                                     

                                                                        




                                                               
                                                








                                                                                
                                                        
                                                         
                 







                                                          
                                    

                               
                                   









                                
/*
 External application support.
 This feature allows lynx to pass a given URL to an external program.
 It was written for three reasons.
 1) To overcome the deficiency	of Lynx_386 not supporting ftp and news.
    External programs can be used instead by passing the URL.

 2) To allow for background transfers in multitasking systems.
    I use wget for http and ftp transfers via the external command.

 3) To allow for new URLs to be used through lynx.
    URLs can be made up such as mymail: to spawn desired applications
    via the external command.

 See lynx.cfg for other info.
*/

#include <LYUtils.h>
#include <HTAlert.h>
#include <LYGlobalDefs.h>
#include <LYExtern.h>
#include <LYCurses.h>

#include <LYLeaks.h>

#ifdef USE_EXTERNALS
void run_external ARGS1(char *, c)
{
	char command[1024];
	lynx_html_item_type *externals2=0;

	if (externals == NULL) return;

	for(externals2=externals; externals2 != NULL;
		 externals2=externals2->next)
	{

	 if (externals2->command != 0
	  && !strncasecomp(externals2->name,c,strlen(externals2->name)))
	 {
	     char *cp;

		if(no_externals && !externals2->always_enabled)
		{
		  HTUserMsg(EXTERNALS_DISABLED);
		  return;
		}

		/*  Too dangerous to leave any URL that may come along unquoted.
		 *  They often contain '&', ';', and '?' chars, and who knows
		 *  what else may occur.
		 *  Prevent spoofing of the shell.
		 *  Dunno how this needs to be modified for VMS or DOS. - kw
		 */
#if defined(VMS) || defined(DOSPATH) || defined(__EMX__)
		sprintf(command, externals2->command, c);
#else /* Unix: */
		cp = quote_pathname(c);
		sprintf(command, externals2->command, cp);
		FREE(cp);
#endif /* VMS */

		if (*command != '\0')
		{

		 HTUserMsg(command);

		 stop_curses();
		 LYSystem(command);
		 start_curses();
		}

		return;
	 }
	}

	return;
}
#endif /* USE_EXTERNALS */