ext/wdm/rb_change.c in wdm-0.1.1 vs ext/wdm/rb_change.c in wdm-0.2.0
- old
+ new
@@ -58,29 +58,29 @@
memcpy(buffer, info->FileName, info->FileNameLength);
// Null-terminate the string
buffer[filename_len] = L'\0';
- WDM_WDEBUG("change in: '%s'", buffer);
+ WDM_DEBUG("change in: '%S'", buffer);
absolute_filepath_len = wcslen(base_dir) + filename_len;
absolute_filepath = ALLOCA_N(WCHAR, absolute_filepath_len + 1); // 1 for NULL
absolute_filepath[0] = L'\0';
wcscat(absolute_filepath, base_dir);
wcscat(absolute_filepath, buffer);
- WDM_WDEBUG("absolute path is: '%s'", absolute_filepath);
+ WDM_DEBUG("absolute path is: '%S'", absolute_filepath);
_wsplitpath(buffer, NULL, NULL, file, ext);
// TODO: Extracting the file name from 'buffer' is only needed when watching sub-dirs
filename[0] = L'\0';
if ( file[0] != L'\0' ) wcscat(filename, file);
if ( ext[0] != L'\0' ) wcscat(filename, ext);
- WDM_WDEBUG("filename: '%s'", filename);
+ WDM_DEBUG("filename: '%S'", filename);
filename_len = wcslen(filename);
// The maximum length of an 8.3 filename is twelve, including the dot.
if (filename_len <= 12 && wcschr(filename, L'~'))
@@ -107,11 +107,11 @@
// Convert to the long filename form. Unfortunately, this
// does not work for deletions, so it's an imperfect fix.
if (GetLongPathNameW(unicode_absolute_filepath, absolute_long_filepath, WDM_MAX_WCHAR_LONG_PATH) != 0) {
absolute_filepath = absolute_long_filepath + 4; // Skip first 4 pointers of "\\?\"
absolute_filepath_len = wcslen(absolute_filepath);
- WDM_WDEBUG("Short path converted to long: '%s'", absolute_filepath);
+ WDM_DEBUG("Short path converted to long: '%S'", absolute_filepath);
}
else {
WDM_DEBUG("Can't convert short path to long: '%s'", rb_w32_strerror(GetLastError()));
}
}
@@ -134,12 +134,10 @@
path = rb_enc_str_new(multibyte_filepath,
multibyte_filepath_buffer_size - 1, // -1 because this func takes the chars count, not bytes count
wdm_rb_enc_utf8);
- OBJ_TAINT(path);
-
return path;
}
static VALUE
extract_change_type_from_notification(const PFILE_NOTIFY_INFORMATION info)
@@ -194,6 +192,6 @@
cWDM_Change = rb_define_class_under(mWDM, "Change", rb_cObject);
rb_define_attr(cWDM_Change, "path", 1, 0);
rb_define_attr(cWDM_Change, "type", 1, 0);
-}
\ No newline at end of file
+}