2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2024-11-22 17:41:51 +00:00
xcat-dep/atftp/debian/patches/dfsg-3-to-winpaths.diff
hamzy bf08ce086d This is the first draft of building packages under Debian
Former-commit-id: 342cdeb67cc99dc5c0da1095d07cf5f239b58c4c
2011-05-03 20:29:30 +00:00

33 lines
1.0 KiB
Diff

diff -urN atftp-0.7.dfsg/tftpd_file.c atftp-0.7.dfsg-winpaths/tftpd_file.c
--- atftp-0.7.dfsg/tftpd_file.c 2008-06-20 10:33:43.000000000 -0400
+++ atftp-0.7.dfsg-winpaths/tftpd_file.c 2008-06-20 10:39:51.000000000 -0400
@@ -474,6 +474,28 @@
/* verify that the requested file exist */
fp = fopen(filename, "r");
+ /* if it didn't exist, consider the possibilty of Windows */
+ if (fp == NULL)
+ {
+ char* idx;
+ idx = strchr(filename,'\\');
+ while (idx) {
+ (*idx) = '/';
+ idx = strchr(filename,'\\');
+ }
+ if (strstr(filename,"/Boot/BCD"))
+ {
+ char bcdfilename[MAXLEN];
+ strncpy(bcdfilename,filename,MAXLEN);
+ strncat(bcdfilename,".",MAXLEN);
+ strncat(bcdfilename,inet_ntoa(sa->sin_addr),MAXLEN);
+ fp = fopen(bcdfilename, "r");
+ }
+ if (fp == NULL)
+ {
+ fp = fopen(filename,"r");
+ }
+ }
#ifdef HAVE_PCRE
if (fp == NULL)
{