setenv ("LC_COLLATE", "C", 1);
setenv ("LC_ALL", "C", 1); */
char *cmd = xmalloc (8 * strlen (tagfile) + sizeof "sort -u -o '' ''");
+#if defined WINDOWSNT || defined MSDOS
+ /* Quote "like this". No need to escape the quotes in the file name,
+ since it is not allowed in file names on these systems. */
+ char *z = stpcpy (cmd, "sort -u -o \"");
+ z = stpcpy (z, tagfile);
+ z = stpcpy (z, "\" \"");
+ z = stpcpy (z, tagfile);
+ stpcpy (z, "\"");
+#else
+ /* Quote 'like this', and escape the apostrophe in the file name. */
char *z = stpcpy (cmd, "sort -u -o '");
char *escaped_tagfile = z;
for (; *tagfile; *z++ = *tagfile++)
z = stpcpy (z, "' '");
z = mempcpy (z, escaped_tagfile, escaped_tagfile_len);
strcpy (z, "'");
+#endif
return system (cmd);
}
return EXIT_SUCCESS;