/*
* temporary names for mknod.
*/
-#define TMP_DIR "/tmp"
-#define TMP_PREFIX "scsi"
+#define TMP_DIR "/dev"
+#define TMP_PREFIX "tmp-scsi"
/*
* XXX Note the 'e' (send output to stderr in all cases), and 'c' (callout)
*/
static void format_serial(char *serial)
{
- char *p = serial;
+ char *p = serial, *q;
+ q = p;
while (*p != '\0') {
- if (isspace(*p))
- *p = '_';
+ if (isspace(*p)) {
+ if (q > serial && q[-1] != '_') {
+ *q = '_';
+ q++;
+ }
+ } else {
+ *q = *p;
+ q++;
+ }
p++;
}
+ *q = '\0';
}
/*