Skip to content

Commit 4f9f9e7

Browse files
improve conversion from header file name to once macro (#518)
1 parent ecc90b8 commit 4f9f9e7

File tree

1 file changed

+1
-1
lines changed
  • snippets/c-lang-common

1 file changed

+1
-1
lines changed

snippets/c-lang-common/once

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# name: #ifndef XXX; #define XXX; #endif
33
# key: once
44
# --
5-
#ifndef ${1:`(upcase (file-name-nondirectory (file-name-sans-extension (or (buffer-file-name) ""))))`_H}
5+
#ifndef ${1:`(upcase (replace-regexp-in-string "[^A-Za-z0-9_]" "_" (file-name-nondirectory (or (buffer-file-name)))))`}
66
#define $1
77

88
$0

0 commit comments

Comments
 (0)