881
882 return 0;
883 }
884
885 void GetRequestFiles(REQUEST *req, char *buffer, int length)
886 {
887 char buf[BUFSIZ];
888
889 memset(buf, 0, sizeof(buf));
890
891 if (req->title) {
892 char *r = req->title;
893 char *ptr = buf;
894
895 while ( *r && strncmp(r,"\\n",2)) {
896 *ptr++ = *r++;
897 }
898 } else if (req->file_list)
899 strlcpy(buf, *req->file_list, sizeof (buf));
900
901 if (*buf == NULL || !strncmp(buf, SPOOLDIR, sizeof(SPOOLDIR)-1))
902 strcpy(buf, "<File name not available>");
903
904 if (strlen(buf) > (size_t) 24) {
905 char *r;
906
907 if (r = strrchr(buf, '/'))
908 r++;
909 else
910 r = buf;
911
912 snprintf(buffer, length, "%-.24s", r);
913 } else
914 strlcpy(buffer, buf, length);
915 return;
916 }
917
918
919 /**
920 ** _Malloc()
921 ** _Realloc()
|
881
882 return 0;
883 }
884
885 void GetRequestFiles(REQUEST *req, char *buffer, int length)
886 {
887 char buf[BUFSIZ];
888
889 memset(buf, 0, sizeof(buf));
890
891 if (req->title) {
892 char *r = req->title;
893 char *ptr = buf;
894
895 while ( *r && strncmp(r,"\\n",2)) {
896 *ptr++ = *r++;
897 }
898 } else if (req->file_list)
899 strlcpy(buf, *req->file_list, sizeof (buf));
900
901 if (*buf == '\0' || !strncmp(buf, SPOOLDIR, sizeof(SPOOLDIR)-1))
902 strcpy(buf, "<File name not available>");
903
904 if (strlen(buf) > (size_t) 24) {
905 char *r;
906
907 if (r = strrchr(buf, '/'))
908 r++;
909 else
910 r = buf;
911
912 snprintf(buffer, length, "%-.24s", r);
913 } else
914 strlcpy(buffer, buf, length);
915 return;
916 }
917
918
919 /**
920 ** _Malloc()
921 ** _Realloc()
|