summaryrefslogtreecommitdiff
path: root/Build/source/texk/musixflx/musixflx-0.83-PATCHES/patch-01-filenames
blob: 1b4bccc36d63e6f6f73a573b6462cd68d9e788d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff -ur musixflx-0.83.orig/musixflx.c musixflx-0.83/musixflx.c
--- musixflx-0.83.orig/musixflx.c	2010-09-25 15:56:09.000000000 +0200
+++ musixflx-0.83/musixflx.c	2010-10-18 11:31:28.147003045 +0200
@@ -106,6 +106,8 @@
 
   char name_of_file [128], n_o_f [128], n_o_logfile[128], MusiXFlxVersion[6];
 
+  char *p;
+
   printf("\n <<< musixflex %s%s >>>\n", VERSION, MYVERSION);
   printf("\n ... decoding command line\n");
 
@@ -130,7 +132,14 @@
 
   strcpy (name_of_file, argv[1]);
 
-  strcpy(n_o_f, strtok(name_of_file, "."));
+  p = strrchr(name_of_file, '.');
+  if (p && !strchr(p + 1, '/')
+#if defined(__MSDOS__) || defined(WIN32)
+      && !strchr(p + 1, '\\')
+#endif
+      )
+    *p = '\0';
+  strcpy(n_o_f, name_of_file);
   strcat(name_of_file, ".mx1");
 
 /*****************************************************