Skip to content

Commit

Permalink
Check for CR LF and no spaces in addition to starting with a URI prefix.
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4737 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Jan 4, 2006
1 parent c4a0b7f commit 3af3148
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/fl_dnd_x.cxx
Expand Up @@ -125,17 +125,19 @@ int Fl::dnd() {
if (local_window) {
local_handle(FL_DND_ENTER, local_window);
} else if (dndversion) {
if (strncmp(fl_selection_buffer[0], "file:///", 8) &&
strncmp(fl_selection_buffer[0], "ftp://", 6) &&
strncmp(fl_selection_buffer[0], "http://", 7) &&
strncmp(fl_selection_buffer[0], "https://", 8)) {
// Send plain text...
fl_sendClientMessage(target_window, fl_XdndEnter, source_window,
dndversion<<24, XA_STRING, 0, 0);
} else {
if ((!strncmp(fl_selection_buffer[0], "file:///", 8) ||
!strncmp(fl_selection_buffer[0], "ftp://", 6) ||
!strncmp(fl_selection_buffer[0], "http://", 7) ||
!strncmp(fl_selection_buffer[0], "https://", 8)) &&
!strchr(fl_selection_buffer[0], ' ') &&
strstr(fl_selection_buffer[0], "\r\n")) {
// Send file/URI list...
fl_sendClientMessage(target_window, fl_XdndEnter, source_window,
dndversion<<24, fl_XdndURIList, XA_STRING, 0);
} else {
// Send plain text...
fl_sendClientMessage(target_window, fl_XdndEnter, source_window,
dndversion<<24, XA_STRING, 0, 0);
}
}
}
Expand Down

0 comments on commit 3af3148

Please sign in to comment.