summaryrefslogtreecommitdiffstats
path: root/package/cgic/0003-restore-cgiFormFileGetTempfileName.patch
blob: f66227b6a6b93aa0b281fbf5507b0cca185e3194 (plain)
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
Restore lost functionality

Probably-Signed-off-by: Dave Bender <bender@benegon.com>
[yann.morin.1998@free.fr: patch was made by Dave, but he
 forgot his SoB line, so I added it]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

diff -rupN cgic206/cgic.c cgic206_tempfile/cgic.c
--- cgic206/cgic.c	2014-03-16 18:17:11.000000000 -0400
+++ cgic206_tempfile/cgic.c	2015-01-21 11:58:45.436384908 -0500
@@ -1278,6 +1278,20 @@ cgiFormResultType cgiFormFileContentType
 	}
 }
 
+const char* cgiFormFileGetTempfileName(
+	char* name)
+{
+	cgiFormEntry *e;
+	e = cgiFormEntryFindFirst(name);
+	if (!e) {
+		return NULL;
+	} else if (!strlen(e->tfileName)) {
+		return NULL;
+	} else {
+		return e->tfileName;
+	}
+}
+
 cgiFormResultType cgiFormFileSize(
 	char *name, int *sizeP)
 {
diff -rupN cgic206/cgic.h cgic206_tempfile/cgic.h
--- cgic206/cgic.h	2014-03-16 18:17:11.000000000 -0400
+++ cgic206_tempfile/cgic.h	2015-01-21 11:53:02.915148026 -0500
@@ -141,6 +141,8 @@ extern cgiFormResultType cgiFormRadio(
 	char *name, char **valuesText, int valuesTotal, 
 	int *result, int defaultV);	
 
+extern const char* cgiFormFileGetTempfileName(char* name);
+
 /* The paths returned by this function are the original names of files
 	as reported by the uploading web browser and shoult NOT be
 	blindly assumed to be "safe" names for server-side use! */
OpenPOWER on IntegriCloud