瀏覽代碼

(obstack_code_rename): Apply safer_name_suffix to name arguments before storing them in T and R records. Reported by Nicholas Cole.

Sergey Poznyakoff 17 年之前
父節點
當前提交
1ef212d0fb
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      src/incremen.c

+ 9 - 2
src/incremen.c

@@ -609,10 +609,17 @@ get_directory_contents (char *dir, dev_t device)
 static void
 obstack_code_rename (struct obstack *stk, char *from, char *to)
 {
+  char *s;
+
+  s = from[0] == 0 ? from :
+                     safer_name_suffix (from, false, absolute_names_option);
   obstack_1grow (stk, 'R');
-  obstack_grow (stk, from, strlen (from) + 1);
+  obstack_grow (stk, s, strlen (s) + 1);
+
+  s = to[0] == 0 ? to:
+                   safer_name_suffix (to, false, absolute_names_option);
   obstack_1grow (stk, 'T');
-  obstack_grow (stk, to, strlen (to) + 1);
+  obstack_grow (stk, s, strlen (s) + 1);
 }
 
 static bool