]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
DVR: limit the filename length to 255 if windows compatible filenames are checked...
authorJaroslav Kysela <perex@perex.cz>
Fri, 19 Feb 2016 16:01:30 +0000 (17:01 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 19 Feb 2016 16:01:30 +0000 (17:01 +0100)
- unfortunately pathconf(filename, _PC_NAME_MAX) returns a large value
  for VFAT (internal unicode handling)

src/dvr/dvr_rec.c

index fd21b030356474c2be4473351cfe2b24d64cdc95..878a7a536f73860d0fab6b0381d40805eaf9a15d 100644 (file)
@@ -752,6 +752,8 @@ pvr_generate_filename(dvr_entry_t *de, const streaming_start_t *ss)
   max = pathconf(filename, _PC_NAME_MAX);
   if (max < 8)
     max = NAME_MAX;
+  if (max > 255 && cfg->dvr_windows_compatible_filenames)
+    max = 255;
   max -= 2;
   j = strlen(filename);
   snprintf(filename + j, sizeof(filename) - j, "/%s", dirsep);